fix(browser): Don't special case DOMExceptions that are also Errors#4156
Closed
nowylie wants to merge 1 commit into
Closed
fix(browser): Don't special case DOMExceptions that are also Errors#4156nowylie wants to merge 1 commit into
nowylie wants to merge 1 commit into
Conversation
Contributor
|
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 |
Member
|
Echoing @AbhiPrasad, thanks for the contribution! I modified your change slightly, so that we don't miss capturing the |
lobsterkatie
added a commit
that referenced
this pull request
Nov 15, 2021
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 #4085 Fixes #3119 [1] https://webidl.spec.whatwg.org/#es-DOMException-specialness
Author
|
@AbhiPrasad @lobsterkatie no worries, thanks for merging a a fix! I look forward to having stack traces on these errors in the future :) |
Contributor
|
This is released with SDK |
onurtemizkan
pushed a commit
that referenced
this pull request
Dec 19, 2021
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 #4085 Fixes #3119 [1] https://webidl.spec.whatwg.org/#es-DOMException-specialness
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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