Skip to content

Instantly share code, notes, and snippets.

@madmag77
Created March 2, 2021 06:30
Show Gist options
  • Save madmag77/8a1bbc6c7ba5edf1738d0e1705965640 to your computer and use it in GitHub Desktop.
Save madmag77/8a1bbc6c7ba5edf1738d0e1705965640 to your computer and use it in GitHub Desktop.
[Dart article] Async code exceptions 1
try {
Future.delayed(Duration(seconds: 1), () {
final _ = 100 ~/ 0;
});
print('Everything is fine!');
} on IntegerDivisionByZeroException {
print('Cant divide to zero');
} finally {
print('Clean-up done');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment