Skip to content

Commit 59d5e1b

Browse files
committed
* core: improve error handling in LibLoader by throwing an error if the library fails to load, ensuring better reliability during dynamic library management.
1 parent 3b10867 commit 59d5e1b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/core/src/helpers/lib-loader.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export class LibLoader<T = unknown> {
2525

2626
async load() {
2727
this._module = await getLib(this._name);
28-
return this._module;
28+
if (!this._module) {
29+
throw new Error(`[ZUI] Failed to load lib: ${this._name}`);
30+
}
31+
return this._module!;
2932
}
3033
}

0 commit comments

Comments
 (0)