Skip to content

Instantly share code, notes, and snippets.

@robertohuertasm
Created July 15, 2020 17:19
Show Gist options
  • Save robertohuertasm/94430e5de60195b856cdb2c2a672f389 to your computer and use it in GitHub Desktop.
Save robertohuertasm/94430e5de60195b856cdb2c2a672f389 to your computer and use it in GitHub Desktop.
futures catchError dartpub
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