From 70f228b145a4e18ff7f7d1258b9eb0fb71b078b2 Mon Sep 17 00:00:00 2001 From: Tjeu Kayim <15987676+TjeuKayim@users.noreply.github.com> Date: Thu, 23 Sep 2021 06:15:42 +0200 Subject: [PATCH] More useful Error in import onerror (#403) 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();