-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
Describe the rule you'd like to see implemented
I'd love to have a lint that detects missing await keyword after return in try / on / catch blocks of async functions.
Without the await keyword in the try block, the on / catch block is ineffective.
Examples
class _Exception {}
Future<bool> foo() async {
throw _Exception();
}
Future<bool> bar() async {
try {
print("Calling foo...");
return /* await */ foo();
} on _Exception catch (e) {
print("We're all good! Exception $e is handled.");
// ...except it's not handled at all, because of the missing `await`
return false;
}
}Additional context
This problem caused the customer-affecting bug in flutterfire / cloud_functions (firebase/flutterfire#2069).
It also broke my team's app yesterday.
noinskit, mgenware, exaby73, tungpham6195, danielgorka and 2 more
Metadata
Metadata
Assignees
Labels
devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug