# `Schooner.Host.TypeError`
[🔗](https://github.com/ausimian/schooner/blob/1.0.0/lib/schooner/host/type_error.ex#L1)

Raised by `Schooner.Host` asserting accessors (`to_*!/2`) when a
Scheme value does not match the shape the host expected.

The exception carries `:op` (a host-supplied label naming the call
site, e.g. `"my-lib/info"`), `:expected` (a short description of the
shape that was demanded, e.g. `"string"`, `"proper list"`), and
`:got` (the actual value, rendered with `inspect/1` in the
message). Tests can pattern on `:op` and `:expected` without
coupling to wording.

# `t`

```elixir
@type t() :: %Schooner.Host.TypeError{
  __exception__: true,
  expected: binary(),
  got: term(),
  message: binary(),
  op: binary()
}
```

---

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