# `NebulaGraphEx.Error`
[🔗](https://github.com/VChain/nebula_graph_ex/blob/v0.1.8/lib/nebula_graph_ex/error.ex#L1)

Represents a NebulaGraph error returned by the server or raised by the client.

## Fields

* `:code` — the `NebulaGraphEx.Error.Code` atom (e.g. `:e_syntax_error`)
* `:code_int` — the raw integer error code from the server
* `:message` — human-readable error message string, or `nil`
* `:category` — one of `:auth`, `:query`, `:connection`, `:server`, `:client`
* `:statement` — the nGQL statement that caused the error, if available

## Example

    iex> {:error, err} = NebulaGraphEx.Graph.query(conn, "INVALID nGQL HERE")
    iex> err.code
    :e_syntax_error
    iex> err.message
    "SyntaxError: syntax error near `nGQL'"

# `category`

```elixir
@type category() :: :auth | :query | :connection | :server | :client
```

# `t`

```elixir
@type t() :: %NebulaGraphEx.Error{
  __exception__: true,
  category: category(),
  code: atom(),
  code_int: integer(),
  message: String.t() | nil,
  statement: String.t() | nil
}
```

---

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