freight v0.3.1 Freight.Payload.ErrorPayload
Error payloads are payloads that are created when an :error tuple has been returned.
Their successful
property is always set to false
.
Link to this section Summary
Functions
Converts any valid error value to an error object that can be supplied to the array of errors in a payload
Manually generates a map representing a generic unsuccessful object. All customized result fields will not be defined, and thus returned as nil
Link to this section Functions
Link to this function
convert_error(string)
Converts any valid error value to an error object that can be supplied to the array of errors in a payload
Link to this function
create_payload(string)
Manually generates a map representing a generic unsuccessful object. All customized result fields will not be defined, and thus returned as nil
Usage
create_payload(["You are not signed in", "Something else"])
will return the following map
%{
successful: false,
errors: ["You are not signed in", "Something else"]
}