fastimage
fastimage copied to clipboard
consider adding try catch block for file.stream!
in Fastimage.File, wrap in try catch so that error is catched and returned as Fastimage.Error.
@spec recv(String.t(), :file) :: {:ok, binary(), File.Stream.t()} | {:error, Error.t()}
defp recv(file_path, :file) do
# {:ok, _data, _file_stream} =
# try do
file_path
|> File.stream!([:read, :compressed, :binary], @file_chunk_size)
|> stream_chunks(1, {0, <<>>, file_path}, 0, 0)
# catch
# end
end