calcinator v2.3.0 Calcinator.Controller.Error

Errors returned by Calcinator.Controller. Public, so that other controllers not using Calcinator.Controller can have same format for errors.

Summary

Functions

Retort returned a 500 JSONAPI error inside a 422 JSONRPC error

The current resource or action is forbidden to the authenticated user

Puts 404 Resource Not Found JSONAPI error in conn with parameter as the source parameter

Renders changeset as an error object using the Calcinator.ChangesetView

Renders encodable as JSON after put_jsonapi_and_status on the conn

Functions

bad_gateway(conn)
bad_gateway(Plug.Conn.t) :: Plug.Conn.t

Retort returned a 500 JSONAPI error inside a 422 JSONRPC error.

forbidden(conn)
forbidden(Plug.Conn.t) :: Plug.Conn.t

The current resource or action is forbidden to the authenticated user

not_found(conn, parameter)

Puts 404 Resource Not Found JSONAPI error in conn with parameter as the source parameter.

render_changeset_error(conn, changeset)
render_changeset_error(Plug.Conn.t, Ecto.Changeset.t) :: Plug.Conn.t

Renders changeset as an error object using the Calcinator.ChangesetView.

render_json(conn, encodable, status)
render_json(Plug.Conn.t, term, atom) :: Plug.Conn.t

Renders encodable as JSON after put_jsonapi_and_status on the conn.