Created
October 3, 2016 15:52
-
-
Save edennis/a8a736e3b412e61cb636d4f32a538470 to your computer and use it in GitHub Desktop.
rescue/catch from stream?
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
iex(1)> stream = File.stream!("does_not_exist") | |
%File.Stream{line_or_bytes: :line, modes: [:raw, :read_ahead, :binary], | |
path: "does_not_exist", raw: true} | |
iex(2)> stream |> Enum.take(1) | |
** (File.Error) could not stream "does_not_exist": no such file or directory | |
(elixir) lib/file/stream.ex:78: anonymous fn/2 in Enumerable.File.Stream.reduce/3 | |
(elixir) lib/stream.ex:1121: anonymous fn/5 in Stream.resource/3 | |
(elixir) lib/enum.ex:2161: Enum.take/2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment