# `CEL.Error`
[🔗](https://github.com/hansihe/pb_ex/blob/v0.2.0/cel_ex/lib/cel/error.ex#L1)

Unified error raised by CEL evaluation, including protovalidate `cel` rules.

`:phase` discriminates `:parse`, `:check`, or `:eval`. Callers `rescue
CEL.Error` once and inspect `:phase` to discriminate if needed.

Parse and check errors say where in the source the error was found: for a
check error, the position of the expression it is about, as
`CEL.Checked.position/2` gives it.

  * `:offset` — the offset in code points.
  * `:line` and `:column` — the 1-based line and column, in code points.
  * `:location` — the source's location, as given to `CEL.parse/2`.

# `phase`

```elixir
@type phase() :: :parse | :check | :eval
```

# `t`

```elixir
@type t() :: %CEL.Error{
  __exception__: term(),
  column: pos_integer() | nil,
  details: map() | nil,
  expr_id: integer() | nil,
  line: pos_integer() | nil,
  location: String.t() | nil,
  message: String.t(),
  offset: non_neg_integer() | nil,
  phase: phase()
}
```

# `exception`

Builds the error. `:message` is always a string: a non-string reason from
the runtime is described in words and kept as `details.reason`.

---

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