Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/js/utils/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ export function triggerEvent(element, type = '', bubbles = false, detail = {}) {
if (!is.element(element) || is.empty(type)) {
return;
}
// error event should not bubble and break error tracking tools
// https://developer.mozilla.org/en-US/docs/Web/API/Element/error_event
if (type === 'error') {
bubbles = false;
}

// Create and dispatch the event
const event = new CustomEvent(type, {
Expand Down
2 changes: 1 addition & 1 deletion src/js/utils/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function fetch(url, responseType = 'text') {
});

request.addEventListener('error', () => {
throw new Error(request.status);
reject(new Error(request.status));
});

request.open('GET', url, true);
Expand Down