johanna v0.2.5 Johanna.Service.ExecutedNotOk exception

case my_func.(my_params) do
  :ok -> :ok
  {:error, context} ->
    raise Johanna.Service.ExecutedNotOk, context: %Johanna.Message{message: context, ...}
end

Summary

Functions

exception(msg)
exception(String.t) :: Exception.t
exception(Keyword.t) :: Exception.t

Callback implementation for Exception.exception/1.

message(exception)
message(Exception.t) :: String.t

Callback implementation for Exception.message/1.

throw(context, message)