View Source StrongParams.Error (strong_params v0.3.0)
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
Summary
Types
@type errors_map() :: %{ optional(atom()) => binary(), optional(atom()) => errors_map() }
@type t() :: %StrongParams.Error{errors: errors_map(), type: binary()}