Created
July 15, 2020 17:19
-
-
Save robertohuertasm/94430e5de60195b856cdb2c2a672f389 to your computer and use it in GitHub Desktop.
futures catchError dartpub
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 { | |
var f = Future.delayed(Duration(milliseconds: 500), () => 'Hola').then((_) => throw Exception('WTF')); | |
await f.catchError(handleError); | |
// await f; | |
print('Exiting main'); | |
} | |
void handleError(e) { | |
print(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment