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 BM-TristanNeumann committed Nov 12, 2024
1 parent 2f3422b commit 8ae1d93
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 @@ -265,8 +265,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 8ae1d93

Please sign in to comment.