Silently failing code

amos-kibet

amos-kibet

Created 7 months ago

Such kinds of function calls can fail, and when they do, they don’t crash the server or raise an error:

Event.update(...)

This can take you a while before you understand why the code/tests are not working. You can fix this by pattern-matching on the return value, like so:

{:ok, _event} = Event.update(...)

and when a different result format is returned, like {:error, _}, the server will crash and and the error raised.