Commit 53e6b63
fix(core): Wrap decodeURI in node stack trace parser to handle malformed URIs (#19400)
This PR wraps `decodeURI` in `node-stack-trace.ts` with a try/catch so
that malformed URIs (e.g. filenames containing `%` sequences that are
not valid percent-encoding) no longer throw a `URIError` and crash the
SDK. The raw filename is returned as a fallback. In addition, we only
call `getModule` if we successfully decode the filename, since in
`getModule` implementations, we also again attempt to decode filenames.
Since we don't have a concrete filename in #19391 which we can reproduce
this, this is rather a "best effort" fix. But I think it's worth having
this either way.
Closes #19391
---------
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 4bb5e03 commit 53e6b63
File tree
2 files changed
+28
-2
lines changed- packages/core
- src/utils
- test/lib/utils
2 files changed
+28
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | | - | |
120 | | - | |
| 120 | + | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| |||
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
395 | 412 | | |
0 commit comments