Created
March 2, 2021 06:38
-
-
Save madmag77/60b160e16cd08dc76240e598a6131364 to your computer and use it in GitHub Desktop.
[Dart article] Async code exceptions 2
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
try { | |
await 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