From cb83434df453919e27d33e22eb633ab24468e998 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Fri, 15 Sep 2017 14:43:37 -0700 Subject: [PATCH] Load exception --- pkg/dev_compiler/lib/js/legacy/dart_library.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/dev_compiler/lib/js/legacy/dart_library.js b/pkg/dev_compiler/lib/js/legacy/dart_library.js index bbf0d4848a17..1902d3879fa7 100644 --- a/pkg/dev_compiler/lib/js/legacy/dart_library.js +++ b/pkg/dev_compiler/lib/js/legacy/dart_library.js @@ -14,6 +14,10 @@ dart_library = /** Note that we cannot use dart_utils.throwInternalError from here. */ function throwLibraryError(message) { + // Dispatch event to allow others to react to the load error without + // capturing the exception. + var errorEvent = new CustomEvent('dartLoadException', { detail: message }); + window.dispatchEvent(errorEvent); throw Error(message); }