Mserror.AuthnError exception (mscmp_syst_authn v0.1.0)

Defines an Mserror compliant error module for the MscmpSystAuthn component.

For more see the MscmpSystError Component documentation.

Summary

Types

Represents the available Kinds of error allowed by this Error type.

t()

Describes the structure of an error of generated by this exception.

Functions

Creates a new error struct with the given kind, message, and options.

Types

kinds()

@type kinds() ::
  :service_management
  | :enumeration_data
  | :network_rule_data
  | :password_rule_data
  | :access_account_instance_assoc_data
  | :access_account_data
  | :account_code
  | :authentication
  | :authenticator_management

Represents the available Kinds of error allowed by this Error type.

Available Kinds

  • :authenticator_management - Failure operating on Authenticator data.
  • :authentication - Failure operating on Authentication data.
  • :account_code - Failure operating on Account Code data.
  • :access_account_data - Failure operating on Access Account data.
  • :access_account_instance_assoc_data - Failure operating on Access Account Instance Assoc data.
  • :password_rule_data - Failure operating on Password Rule data.
  • :network_rule_data - Failure operating on Network Rule data.
  • :enumeration_data - Failure operating on Enumeration data.
  • :service_management - Failure performing a Service Management operation.

t()

@type t() :: %Mserror.AuthnError{
  __exception__: true,
  __mscomponent__: module(),
  __mserror__: true,
  cause: t() | Exception.t() | term() | nil,
  context: MscmpSystError.Types.Context.t() | nil,
  kind: kinds(),
  message: String.t()
}

Describes the structure of an error of generated by this exception.

The cause attribute allows for errors to be nested.

Attributes

The following attributes are those which are set or modified by the user when working with errors.

  • kind - The kind of error, see kinds/0 for the available Kinds.

  • message - A string describing the error.

  • context - contextual information for better understanding the error. If provided, the context should be of type MscmpSystError.Types.Context.t/0.

  • cause - The cause of the error, which can be an exception, an error tuple, or any other term.

Internal Attributes

These attributes have their values set at compile time and are used internally by the MscmpSystError framework. They are not to be altered by user code. Reading these attributes in user code is safe, however.

  • __mserror__ - Always true, indicates that this error is compatible with the MscmpSystError framework.

  • __mscomponent__ - The component that generated the error.

Functions

new(kind, message, opts \\ [])

@spec new(kind :: kinds(), message :: String.t(), opts :: keyword()) :: t()

Creates a new error struct with the given kind, message, and options.

Parameters

  • kind - The kind of error, see kinds/0 for the available Kinds.

  • message - A string describing the error.

  • opts - A keyword list of additional options.

Options

  • :context - contextual information for better understanding the error. If provided, the context should be of type MscmpSystError.Types.Context.t/0.

  • :cause - The cause of the error, which can be an exception, an error tuple, or any other term.

  • :parse_error - An error result conforming with MscmpSystError.Types.parsable_error/0 to be parsed overriding certain attributes of the exception struct. When provided the message parameter is treated as a default message which can be overridden by a message supplied by the error result provided to this option. The cause attribute of the exception struct will be set to a value derived from this option's value, ignoring the :cause option if provided; typically you would not provide both :parse_error and :cause in the same call to new/3.

Returns

Returns a struct of this error type with the error details.