Encryptor.Ecto.SerializationError exception (Encryptor.Ecto v0.2.0)

Copy Markdown View Source

Raised when the serializer behind Encryptor.Ecto.Map fails on a value (ADR-0001 decision 6).

The serializer runs on the plaintext side of the type - encoding before the dump, decoding after the load - so its failure is neither an encryption failure nor an integrity event, and it gets its own exception rather than being folded into either.

:serializer names the module that failed (Jason by default, per decision

  1. and :direction says which half of the round trip it failed in. Neither carries the value: a serialization failure is exactly the place where a plaintext is closest to hand, and exactly the place ADR-0001 decision 6 calls the least excusable leak.

Summary

Types

Which half of the serializer round trip failed.

t()

An exception in the encrypted-field family.

Types

direction()

@type direction() :: :encode | :decode | nil

Which half of the serializer round trip failed.

t()

@type t() :: %Encryptor.Ecto.SerializationError{
  __exception__: true,
  column: term(),
  context_keys: term(),
  direction: term(),
  reason: term(),
  serializer: term(),
  table: term(),
  tenant: term()
}

An exception in the encrypted-field family.