...or pattern matching in case of dynamically-typed languages:
case some_operation() do
{:ok, result} -> # do something with result
{:error, error} -> # handle the error
end