View Source Arke.Utils.ErrorGenerator (Arke v1.1.33)

Documentation for Arke.Utils.ErrorGenerator

Link to this section Summary

Functions

Create standardized errors

Link to this section Types

@type t() :: {:error, [%{context: String.t(), message: String.t()}]}

Link to this section Functions

@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"}, ...]}