calcinator v5.0.0 Calcinator.Controller.Error View Source
Errors returned by Calcinator.Controller
. Public, so that other controllers not using Calcinator.Controller
can
have same format for errors.
Link to this section Summary
Functions
Retort returned a 500 JSONAPI error inside a 422 JSONRPC error
The resource was deleted
The current resource or action is forbidden to the authenticated user
Puts 504 Gateway Timeout JSONAPI error in conn
Puts 404 Resource Not Found JSONAPI error in conn
with parameter
as the source parameter
Puts 500 Internal Server Error JSONAPI error in conn
with title "Ownership Error"
Converts an {:error, _}
tuple from Calcinator
into a JSONAPI document and encodes it as the conn
response
Puts JSONAPI Content Type in the Response of the conn
Renders changeset
as an error object using the Alembic.Document.from_ecto_changeset/1
Converts an error reason
from that isn’t a standard format (such as those from the backing store) to a
500 Internal Server Error JSONAPI error, but with id
set to id
that is also used in Logger.error
, so that
reason
, which should remain private to limit implementation disclosures that could lead to security issues
Renders encodable
as JSON after put_jsonapi_and_status
on the conn
Puts 422 Unprocessable Entity JSONAPI error in conn
with title "Sandbox Access Disallowed"
Puts 422 Unrpcessable Entity JSONAPI error in conn
with title "Child missing"
Link to this section Functions
Retort returned a 500 JSONAPI error inside a 422 JSONRPC error.
The resource was deleted
The current resource or action is forbidden to the authenticated user
Puts 504 Gateway Timeout JSONAPI error in conn
.
not_found(Plug.Conn.t, String.t) :: Plug.Conn.t
Puts 404 Resource Not Found JSONAPI error in conn
with parameter
as the source parameter.
Puts 500 Internal Server Error JSONAPI error in conn
with title "Ownership Error"
.
Converts an {:error, _}
tuple from Calcinator
into a JSONAPI document and encodes it as the conn
response.
Puts JSONAPI Content Type in the Response of the conn
render_changeset_error(Plug.Conn.t, Ecto.Changeset.t) :: Plug.Conn.t
Renders changeset
as an error object using the Alembic.Document.from_ecto_changeset/1
.
render_error_reason(Plug.Conn.t, reason :: term) :: Plug.Conn.t
Converts an error reason
from that isn’t a standard format (such as those from the backing store) to a
500 Internal Server Error JSONAPI error, but with id
set to id
that is also used in Logger.error
, so that
reason
, which should remain private to limit implementation disclosures that could lead to security issues.
Log Messages
id=UUIDv4 reason=inspect(reason)
Returns
Plug.Conn.t
- ThePlug.Conn.t
is halted withPlug.Conn.halt/1
render_json(Plug.Conn.t, term, atom) :: Plug.Conn.t
Renders encodable
as JSON after put_jsonapi_and_status
on the conn
.
sandbox_access_disallowed(Plug.Conn.t) :: Plug.Conn.t
Puts 422 Unprocessable Entity JSONAPI error in conn
with title "Sandbox Access Disallowed"
.
sandbox_token_missing(Plug.Conn.t) :: Plug.Conn.t
Puts 422 Unrpcessable Entity JSONAPI error in conn
with title "Child missing"
.