Created
March 12, 2020 05:42
-
-
Save AlexKenbo/2bbc67fa67cdce5efca1c0e2087e8a21 to your computer and use it in GitHub Desktop.
Stream error
This file contains hidden or 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() { | |
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