Created with <3 with dartpad.dev.
Created
January 22, 2024 14:47
-
-
Save mehulpamale/96b2c798da039d75ce43d4e4c1ac0011 to your computer and use it in GitHub Desktop.
dart catchError
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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