Skip to content

Commit

Permalink
fix: handle module error on start
Browse files Browse the repository at this point in the history
  • Loading branch information
npenin committed Sep 4, 2024
1 parent 1881faf commit 5be7640
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ export class Module extends SimpleInjector

public start(toInject?: string[], f?: Injectable<unknown>)
{
return new Promise<void>((resolve) =>
return new Promise<void>((resolve, reject) =>
{
if (arguments.length > 0)
Module.o.on('stop', this.injectWithName(toInject, f));
Module.o.on('stop', () => resolve());
Module.o.on('error', err => reject(err.error));
Module.o.start(this.name);
})
}
Expand Down

0 comments on commit 5be7640

Please sign in to comment.