Encrypted.Error exception (Encrypted v0.1.0)

Copy Markdown View Source

Raised when an encrypted field cannot be encrypted or loaded safely.

The reason field is stable and matchable. The message tells an operator what to restore or configure. Neither field contains plaintext, key material, or a complete ciphertext.

Summary

Types

reason()

@type reason() ::
  :authentication_failed
  | :invalid_key
  | :invalid_key_source
  | :malformed_envelope
  | :missing_active_key_id
  | :missing_key_ring
  | {:environment_variable_missing, binary()}
  | {:invalid_key_context, :table | :field}
  | {:rotation_updated_multiple_rows, pos_integer()}
  | {:unknown_key_id, byte()}
  | {:unknown_version, byte()}

t()

@type t() :: %Encrypted.Error{
  __exception__: term(),
  message: binary(),
  reason: reason()
}