retort v2.1.0 Retort.Response.Error
A JSON-RPC Response Error object
Summary
Functions
Uses rendered changset
as data for error
Uses JSON API document
as data for error. Only use when the document
is a JSON API errors document
Converts JSON decoded map with String.t
keys to t
Looks up predefined t
Converts t
to errors returned by Calcinator
and Calcinator.Resources
callbacks
Types
Functions
Uses rendered changset
as data for error.
Uses JSON API document
as data for error. Only use when the document
is a JSON API errors document.
from_json(map)
from_json(%{required(binary) => integer, required(binary) => binary, optional(term) => term}) :: t
Converts JSON decoded map with String.t
keys to t
.
From error with data
iex> Retort.Response.Error.from_json(%{"code" => 0, "data" => "Data", "message" => "Zero"})
%Retort.Response.Error{code: 0, data: "Data", message: "Zero"}
From error without data
iex> Retort.Response.Error.from_json(%{"code" => 0, "message" => "Zero"})
%Retort.Response.Error{code: 0, data: nil, message: "Zero"}
Looks up predefined t
.
to_calcinator_error(error, changeset)
to_calcinator_error(t, maybe_changeset :: Ecto.Changeset.t | nil) :: {:error, :bad_gateway} | {:error, :not_found} | {:error, :sandbox_access_disallowed} | {:error, Ecto.Changeset.t}
Converts t
to errors returned by Calcinator
and Calcinator.Resources
callbacks.