PB.ValueError exception (PB v0.1.0)

Copy Markdown View Source

Input value or shape failure: a caller-supplied term does not fit the field's declared type, presence, or message structure.

The relevant data is carried in typed fields (:expected, :got, :min, :max, :value, :enum, :protobuf_message, :unknowns, :extensions), and :path locates the offending field. See PB.Error for the error model.

Summary

Types

Which value/shape failure this is.

t()

Types

kind()

@type kind() ::
  :unknown_field
  | :invalid_value
  | :value_out_of_range
  | :invalid_oneof
  | :invalid_enum_value
  | :unknown_enum_value
  | :missing_required
  | :message_name_mismatch
  | :invalid_unknown_field
  | :invalid_unknown_fields
  | :absent
  | :unknown_wire_fields
  | :extensions_present

Which value/shape failure this is.

t()

@type t() :: %PB.ValueError{
  __exception__: true,
  enum: atom() | nil,
  expected: term(),
  extensions: term(),
  got: term(),
  kind: kind() | nil,
  max: term(),
  message_name: atom() | nil,
  min: term(),
  operation: PB.Error.operation() | nil,
  path: [PB.Error.path_element()],
  protobuf_message: atom() | nil,
  reason: term(),
  unknowns: term(),
  value: term()
}