Refactor catch error functions
Open
enhancement
hacktoberfest
- Dominant language
- Elixir
- Stars
- 6
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Examples of use:
```elixir
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}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.