Skip to content

Instantly share code, notes, and snippets.

@jiahaog
Created November 18, 2020 23:57
Show Gist options
  • Save jiahaog/e03d649069b5e3427ee53244ea1d9735 to your computer and use it in GitHub Desktop.
Save jiahaog/e03d649069b5e3427ee53244ea1d9735 to your computer and use it in GitHub Desktop.
Dart unhandled exception
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