Skip to content

Instantly share code, notes, and snippets.

@macoshita
Last active July 5, 2019 07:04
Show Gist options
  • Save macoshita/fec12d9fcf8b595e5c8ee6372d8ce017 to your computer and use it in GitHub Desktop.
Save macoshita/fec12d9fcf8b595e5c8ee6372d8ce017 to your computer and use it in GitHub Desktop.
Why warn unhandled exception
void main() async {
final a = Future.delayed(const Duration(seconds: 1));
final b = Future.error(2);
try {
await Future.wait([a, b]); // Warn uncatched error if remove this line.
await a;
await b;
} catch (e) {
print(e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment