Repository navigation
Commit 0ec2403
committed
fix(dsn): raise BadDsn instead of a bare ValueError for invalid ports
Dsn.__init__ reads parts.port, which urlsplit parses lazily and which
raises a bare ValueError for ports outside 0-65535 or not numeric. The
exception escapes Dsn, so a typo in SENTRY_DSN breaks Client() at startup
with a traceback in urllib/parse.py and except BadDsn cannot catch it.
Every other field in __init__ raises BadDsn, and project_id already uses
the same try/except idiom. Extend it to the port.1 parent 566beb0 commit 0ec2403
2 files changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
335 | 344 | | |
336 | 345 | | |
337 | | - | |
| 346 | + | |
338 | 347 | | |
339 | 348 | | |
340 | 349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
159 | 164 | | |
160 | 165 | | |
161 | 166 | | |
| |||
0 commit comments