NimbleOptions.ValidationError exception (NimbleOptions v1.1.1)

View Source

An error that is returned (or raised) when options are invalid.

Since this is an exception, you can either raise it directly with raise/1 or turn it into a message string with Exception.message/1.

See %NimbleOptions.ValidationError{} for documentation on the fields.

Summary

Types

t()

@type t() :: %NimbleOptions.ValidationError{
  __exception__: term(),
  key: atom() | [atom()],
  keys_path: [atom()],
  message: term(),
  redact: boolean(),
  value: term()
}

Functions

%NimbleOptions.ValidationError{}

(struct)

The error struct.

Only the following documented fields are considered public. All other fields are considered private and should not be referenced:

  • :key (atom/0 or list of atom/0) - The key that did not successfully validate. When several keys are involved in the same error (for example, unknown options reported as a group), this is the list of those keys.

  • :keys_path (list of atom/0) - If the key is nested, this is the path to the key.

  • :value (term/0) - The value that failed to validate. This field is nil if there was no value provided.