Uh oh!
There was an error while loading. Please reload this page.
fix(browser): Don't special case DOMExceptions that are also Errors - #4156
fix(browser): Don't special case DOMExceptions that are also Errors#4156nowylie wants to merge 1 commit into
Conversation
AbhiPrasad
commented
Nov 15, 2021
Awesome, thanks for your contribution! Can we please leave a comment above the new conditional explaining the instance check (maybe with some links to docs)? We can also update the comments below it that refer to |
lobsterkatie
commented
Nov 15, 2021
Echoing @AbhiPrasad, thanks for the contribution! I modified your change slightly, so that we don't miss capturing the |
Inspired by #4156 - h/t @nowylie. According to the spec[1], all `DOMExceptions` should also be `Error`s (and therefore potentially have a stacktrace), though this isn't universally followed. In the cases in which it is, we should be capturing that stack. Fixes#4085Fixes#3119 [1] https://webidl.spec.whatwg.org/#es-DOMException-specialness
nowylie
commented
Nov 16, 2021
@AbhiPrasad@lobsterkatie no worries, thanks for merging a a fix! I look forward to having stack traces on these errors in the future :) |
AbhiPrasad
commented
Nov 16, 2021
This is released with SDK |
Inspired by #4156 - h/t @nowylie. According to the spec[1], all `DOMExceptions` should also be `Error`s (and therefore potentially have a stacktrace), though this isn't universally followed. In the cases in which it is, we should be capturing that stack. Fixes#4085Fixes#3119 [1] https://webidl.spec.whatwg.org/#es-DOMException-specialness
As mentioned in #4085,
DOMExceptions are not a legacy API and on current browsers are instances ofError. This change tests whether the exception is an instance ofErrorbefore throwing away all the good bits.Before submitting a pull request, please take a look at our
Contributing guidelines and verify:
yarn lint) & (yarn test).Fixes#4085
Fixes#3119