Improved script loading error message handler

canary
WolverinDEV 2020-08-21 00:10:20 +02:00
parent cb00b236bb
commit 754ec6b3ab
1 changed files with 2 additions and 0 deletions

View File

@ -122,6 +122,8 @@ export async function load_multiple(paths: SourcePath[], options: MultipleOption
let errorMessage;
if(error instanceof LoadSyntaxError)
errorMessage = error.source.message;
else if(typeof error === "string")
errorMessage = error;
else
errorMessage = "View the browser console for more information!";
critical_error("Failed to load script " + script_name(result.failed[0].request, true), errorMessage);