# `Bourse.Symbol.Error`
[🔗](https://github.com/ZenHive/bourse/blob/main/lib/bourse/symbol/error.ex#L1)

Error raised when symbol conversion fails.

Provides detailed context about what went wrong, including the symbol,
reason, exchange ID, and market type when available.

# `reason`

```elixir
@type reason() ::
  :invalid_format
  | :pattern_not_found
  | :unknown_quote_currency
  | :parse_failed
  | :unrepresentable_id
  | {:unsupported_prefix, String.t()}
```

# `t`

```elixir
@type t() :: %Bourse.Symbol.Error{
  __exception__: term(),
  exchange_id: String.t() | nil,
  market_type: atom() | nil,
  message: String.t(),
  reason: reason(),
  symbol: String.t() | nil
}
```

# `invalid_format`

```elixir
@spec invalid_format(String.t()) :: t()
```

Creates an error for invalid symbol format.

# `new`

```elixir
@spec new(
  String.t(),
  keyword()
) :: t()
```

Creates a symbol error with optional symbol, reason, exchange, and market context.

# `parse_failed`

```elixir
@spec parse_failed(String.t(), term()) :: t()
```

Creates an error for parse failures.

# `pattern_not_found`

```elixir
@spec pattern_not_found(String.t(), atom(), String.t() | nil) :: t()
```

Creates an error for missing pattern configuration.

# `unknown_quote_currency`

```elixir
@spec unknown_quote_currency(String.t(), String.t() | nil) :: t()
```

Creates an error for unknown quote currency.

# `unrepresentable_id`

```elixir
@spec unrepresentable_id(String.t(), String.t(), String.t() | nil, atom() | nil) ::
  t()
```

Creates an error when a reverse conversion rewrote an id without unifying it.

Used when a pattern path partially transforms an exchange id (e.g. upcase)
but does not produce a unified symbol — returning that intermediate would be
a plausible-but-wrong string that resolves to nothing.

# `unsupported_prefix`

```elixir
@spec unsupported_prefix(String.t(), String.t()) :: t()
```

Creates an error for unsupported prefix patterns.

---

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