|
|
|
|
|
by sergiotapia
2540 days ago
|
|
You need to do it this way, it's more idiomatic: with {:user_created?, {:ok, user}} <- create_user do
# do something with `user`.
else
{:user_created?, {:error, errors}} ->
# something
_ ->
# some unhandled error
end
And so on, use an atom on the fly to identify branches and error conditions. But honestly most of the time you worry about happy paths and Let It Crash. |
|