-
Couldn't load subscription status.
- Fork 16
Open
Labels
Description
In some cases, we're currently returning {:error, "binary with error message…"} tuples, which may complicate proper error handling because the binary message is harder to match against.
Instead, we should return structured error tuples, e.g.
{:error, {:interrupted, status}}
# …instead of
{:error, "SCP exited before completing the transfer (#{status})"}– lib/sshkit/scp/download.ex:170
See also http://michal.muskala.eu/2017/02/10/error-handling-in-elixir-libraries.html#okerror-tuples.