View Source Splode.Error behaviour (splode v0.2.4)

Use this module to create an aggregatable error.

For example:

defmodule MyApp.Errors.InvalidArgument do
  use Splode.Error, fields: [:name, :message], class: :invalid

  def message(%{name: name, message: message}) do
    "Invalid argument #{name}: #{message}"
  end
end

Summary

Types

Callbacks

@callback error_class?() :: boolean()
@callback from_json(map()) :: struct()
@callback splode_error?() :: boolean()