From 4f69f5791e4310b7086be5f4843696a75b8ee1c0 Mon Sep 17 00:00:00 2001 From: Tjeu Kayim <15987676+TjeuKayim@users.noreply.github.com> Date: Tue, 21 Sep 2021 21:53:50 +0200 Subject: [PATCH] More useful Error in import onerror See https://github.com/getsentry/sentry-javascript/issues/2546#issuecomment-703331367 --- bundler/mod.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bundler/mod.ts b/bundler/mod.ts index a56abcfa8..e7f41f43a 100644 --- a/bundler/mod.ts +++ b/bundler/mod.ts @@ -37,7 +37,9 @@ export const bundlerRuntimeCode = ` e.onload = function() { y(a[s]); }; - e.onerror = n; + e.onerror = function(g) { + n(new Error('script failed to load ' + g.target.src)); + }; p += f; if (r) { p += '?t=' + (new Date).getTime();