This commit is contained in:
parent
4ec30a8ec8
commit
3db1515ecf
@ -1,5 +1,6 @@
|
|||||||
import { Struct } from './struct';
|
import { Struct } from './struct';
|
||||||
import { load } from './loader';
|
import { load } from './loader';
|
||||||
|
import { extendErrorMessage } from './common';
|
||||||
|
|
||||||
// Store Loaded Structures
|
// Store Loaded Structures
|
||||||
const structures: Record<string, Struct> = {};
|
const structures: Record<string, Struct> = {};
|
||||||
@ -20,11 +21,7 @@ export function getStructure(name: string) {
|
|||||||
// Return
|
// Return
|
||||||
return target;
|
return target;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
let message = 'Error Loading ' + name;
|
throw new Error(extendErrorMessage(e, 'Loading ' + name));
|
||||||
if (e instanceof Error) {
|
|
||||||
message += ': ' + e.message;
|
|
||||||
}
|
|
||||||
throw new Error(message);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user