Skip to content

Instantly share code, notes, and snippets.

@madmag77
Created March 2, 2021 06:55
Show Gist options
  • Save madmag77/54af26e8e9fffce153ac2e9b89c81699 to your computer and use it in GitHub Desktop.
Save madmag77/54af26e8e9fffce153ac2e9b89c81699 to your computer and use it in GitHub Desktop.
[Dart article] Async code exceptions 7
try {
await Future.delayed(Duration(seconds: 1), () {
print('Its fie so far');
});
await Future(() {
print('Then started');
throw 'random exception';
});
} on IntegerDivisionByZeroException {
print('Cant divide to zero');
} catch (e, s) {
print('All other exceptions: $e');
} finally {
print('Clean-up done');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment