# `PB.ValueError`
[🔗](https://github.com/hansihe/pb_ex/blob/v0.2.0/pb/lib/pb/value_error.ex#L1)

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. Errors from `PB.TextFormat` also
carry the 1-based `:line` and `:column` of the offending text. See
`PB.Error` for the error model.

# `kind`

```elixir
@type kind() ::
  :unknown_field
  | :invalid_value
  | :value_out_of_range
  | :invalid_oneof
  | :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`

```elixir
@type t() :: %PB.ValueError{
  __exception__: term(),
  column: pos_integer() | nil,
  enum: atom() | nil,
  expected: term(),
  extensions: term(),
  got: term(),
  kind: kind() | nil,
  line: pos_integer() | 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()
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
