You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! First of all, thanks for the great work!
I bumped into an exception in a non-bang function running a simple download pipeline, when using code like
case SftpClient.stream_file(conn, path) do
{:ok, data} -> do_something_with(data)
{:error, reason} -> {:error, reason}
end
Can't access the sftp at the moment, but the error is pretty clear
I'm using 1.3.5 but didn't see any related diff in last commits
Didn't dig into the problem yet, pretty noob in elixir, but will try to take a look (and in the meanwhile add some defensive try rescue :P )
The text was updated successfully, but these errors were encountered:
I'm afraid that the exception is raised when evaluating the stream in your do_something_with_data function.
To clear things up: stream_file just creates the stream but does not evaluate it until you call Enum.to_list/1 or Stream.run/1. In fact, stream_file and its brother stream_file! will only return an error or raise when you are trying to stream a non-regular file, such as a directory or symbolic link.
The general behavior is consistent with how File.stream!/1 handles streaming. I agree that it might be a bit misleading. We should probably think about deprecating the non-bang version in the long run.
Hi! First of all, thanks for the great work!
I bumped into an exception in a non-bang function running a simple download pipeline, when using code like
Can't access the sftp at the moment, but the error is pretty clear
I'm using 1.3.5 but didn't see any related diff in last commits
Didn't dig into the problem yet, pretty noob in elixir, but will try to take a look (and in the meanwhile add some defensive try rescue :P )
The text was updated successfully, but these errors were encountered: