-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Onerror Callback Support for Errors Fetching External Import Map #2324
Conversation
File size impactMerging onerror-callback-support into master will impact 3 files in 2 groups. browser (2/2)
node (1/1)
extras (0/8)No impact on files in extras group. |
src/features/import-maps.js
Outdated
try { | ||
script.onerror(); | ||
} catch(callbackErr) { | ||
callbackErr.message = 'Error during onerror script for systemjs-importmap: ' + script.src + '\n' + callbackErr.message; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error should be obtainable from the stack anyway, so let's remove this try-catch wrapper rather. Or did you specifically find the stack didn't have the information needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stack has the required info, I will remove the try-catch, thanks for the quick review 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks for the PR. Just the one change request.
Hi,
These changes are for being able to execute custom error handling logic when fetching external import maps. On event of this error, if defined, the script in the
onerror
attribute will be executed.This is addressing this issue.