Examples of use:
iex> e = {:error, :bad}
iex> Result.catch_error(e, fn :bad -> {:ok, 123} end)
{:ok, 123}
iex> Result.catch_error(e, fn :wrong -> {:ok, 345} end)
{:error, :bad}
iex> Result.catch_error({:ok, 987}, fn :bad -> {:ok, 123} end)
{:ok, 987}