Skip to content

Instantly share code, notes, and snippets.

@mehulpamale
Created January 22, 2024 14:47
Show Gist options
  • Save mehulpamale/96b2c798da039d75ce43d4e4c1ac0011 to your computer and use it in GitHub Desktop.
Save mehulpamale/96b2c798da039d75ce43d4e4c1ac0011 to your computer and use it in GitHub Desktop.
dart catchError
void main() async {
await Future.wait([Future(() => throw Exception())])
.then((value) => true)
.catchError((final _) {
print('caught the error :)');
return true;
});
print('executed successfully :)');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment