# `ScoutApm.Error.ErrorData`

Internal representation of an error to be sent to Scout APM.

# `t`

```elixir
@type t() :: %ScoutApm.Error.ErrorData{
  context: map(),
  environment: map() | nil,
  exception_class: String.t(),
  host: String.t() | nil,
  message: String.t(),
  request_components: map() | nil,
  request_id: String.t() | nil,
  request_params: map() | nil,
  request_session: map() | nil,
  request_uri: String.t() | nil,
  revision_sha: String.t() | nil,
  trace: [String.t()]
}
```

# `from_exception`

```elixir
@spec from_exception(
  Exception.t(),
  keyword()
) :: t()
```

Creates an ErrorData struct from an Elixir exception.

# `from_telemetry`

```elixir
@spec from_telemetry(
  :error | :throw | :exit,
  term(),
  Exception.stacktrace(),
  keyword()
) :: t() | nil
```

Creates an ErrorData struct from telemetry exception data.

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Converts the ErrorData to a map suitable for JSON encoding.

---

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