Add error messages when external library loading fails.

This commit is contained in:
kovacsv 2022-02-23 17:56:49 +01:00
parent a5f4d41455
commit 722e8db2e9
4 changed files with 244 additions and 241 deletions

View File

@ -50,6 +50,7 @@ export class Importer3dm extends ImporterBase
onFinish (); onFinish ();
}); });
}).catch (() => { }).catch (() => {
this.SetError ('Failed to load rhino3dm.');
onFinish (); onFinish ();
}); });
} else { } else {

View File

@ -285,7 +285,7 @@ class GltfExtensions
callbacks.onSuccess (); callbacks.onSuccess ();
}); });
}).catch (() => { }).catch (() => {
callbacks.onError (); callbacks.onError ('Failed to load draco decoder.');
}); });
} else { } else {
callbacks.onSuccess (); callbacks.onSuccess ();
@ -616,8 +616,8 @@ export class ImporterGltf extends ImporterBase
this.ImportModel (gltf); this.ImportModel (gltf);
onFinish (); onFinish ();
}, },
onError : () => { onError : (message) => {
this.SetError ('Failed to load draco decoder.'); this.SetError (message);
onFinish (); onFinish ();
} }
}); });

View File

@ -51,6 +51,7 @@ export class ImporterIfc extends ImporterBase
onFinish (); onFinish ();
}); });
}).catch (() => { }).catch (() => {
this.SetError ('Failed to load web-ifc.');
onFinish (); onFinish ();
}); });
} else { } else {

View File

@ -74,6 +74,7 @@ export class ImporterThreeBase extends ImporterBase
LoadLibraries (libraries, () => { LoadLibraries (libraries, () => {
this.LoadModel (fileContent, onFinish); this.LoadModel (fileContent, onFinish);
}, () => { }, () => {
this.SetError ('Failed to load three.js loader.');
onFinish (); onFinish ();
}); });
} }