fastimage icon indicating copy to clipboard operation
fastimage copied to clipboard

consider adding try catch block for file.stream!

Open stephenmoloney opened this issue 8 years ago • 0 comments

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

stephenmoloney avatar Feb 22 '18 10:02 stephenmoloney