Created
April 17, 2020 14:26
-
-
Save tailorvj/3989551fa8d514a6517725ed056f46d3 to your computer and use it in GitHub Desktop.
try/catch/finally exception handling in Dart
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() { | |
try { | |
print('going to throw an exception'); | |
int.parse("some string"); | |
} | |
catch (exception) { | |
print(exception); | |
} | |
finally{ | |
print('this always runs'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment