StrongParams.Error (strong_params v0.2.3) View Source

This module defines a StrongParams.Error.t/0 struct that stores filtering errors.

When using Phoenix action_fallback the fallback module will receive a tuple of {:error, %StrongParams.Error{}}

defmodule YourPhoenixApp.Fallback do

  def call(conn, %StrongParams.Error{}) do
    send_resp(conn, 400, "Your custom msg")
  end
end

Link to this section Summary

Link to this section Types

Specs

errors_map() :: %{
  optional(atom()) => binary(),
  optional(atom()) => errors_map()
}

Specs

t() :: %StrongParams.Error{errors: errors_map(), type: binary()}