Created
November 18, 2020 23:57
-
-
Save jiahaog/e03d649069b5e3427ee53244ea1d9735 to your computer and use it in GitHub Desktop.
Dart unhandled exception
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() async { | |
try { | |
await Future(() { | |
Future(() { | |
throw 'foo'; | |
}); | |
print('future completed'); | |
}); | |
} catch (e) { | |
// This is not printed. | |
print('catches the error'); | |
} | |
print('all ok'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment