Skip to content

Commit

Permalink
handle and pass on exception for async scope initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Ownii authored and Martin Förster committed May 21, 2024
1 parent fb19c79 commit 009ce42
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions injectable/lib/src/get_it_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,12 @@ class GetItHelper {
getIt.pushNewScope(
scopeName: name,
init: (getIt) async {
await init(this);
completer.complete(getIt);
try {
await init(this);
completer.complete(getIt);
} catch (e, s) {
completer.completeError(e, s);
}
},
dispose: dispose,
);
Expand Down

0 comments on commit 009ce42

Please sign in to comment.