Improve Error Message
All checks were successful
CI / Build (push) Successful in 15s

This commit is contained in:
TheBrokenRail 2025-02-25 04:42:42 -05:00
parent 4ec30a8ec8
commit 3db1515ecf

View File

@ -1,5 +1,6 @@
import { Struct } from './struct';
import { load } from './loader';
import { extendErrorMessage } from './common';
// Store Loaded Structures
const structures: Record<string, Struct> = {};
@ -20,11 +21,7 @@ export function getStructure(name: string) {
// Return
return target;
} catch (e) {
let message = 'Error Loading ' + name;
if (e instanceof Error) {
message += ': ' + e.message;
}
throw new Error(message);
throw new Error(extendErrorMessage(e, 'Loading ' + name));
}
}
}