Arke.Utils.ErrorGenerator (Arke v0.1.8)
Documentation for Arke.Utils.ErrorGenerator
Link to this section Summary
Functions
Create standardized errors
Link to this section Types
Link to this section Functions
Link to this function
create(context, errors)
@spec create(context :: String.t(), errors :: list() | String.t()) :: {:error, [%{context: String.t(), message: String.t()}]}
Create standardized errors
parameters
Parameters
- context => string => the context where the error has been generated
errors => list | string => the error itself
example
Example
iex> Arke.Utils.ErrorGenerator.create(:auth, "login error")
return
Return
{:error , [%{context: "context_value", message: "message_value"}, ...]}