Skip to content

Instantly share code, notes, and snippets.

@AlexKenbo
Created March 12, 2020 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexKenbo/2bbc67fa67cdce5efca1c0e2087e8a21 to your computer and use it in GitHub Desktop.
Save AlexKenbo/2bbc67fa67cdce5efca1c0e2087e8a21 to your computer and use it in GitHub Desktop.
Stream error
void main() {
Future<void> tryThings(Stream<int> data) async {
try {
await for (var x in data) {
print("Data: $x");
}
} catch (e) {
print(e);
}
}
tryThings(Stream<int>.error("Error"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment