void main() async { print(await foo().catchError((_) => false)); } Future foo() async { throw Error(); // return Future.value(true); }