# `SnakeBridge.DynamicException`
[🔗](https://github.com/nshkrdotcom/snakebridge/blob/v0.14.0/lib/snakebridge/dynamic_exception.ex#L1)

Dynamically creates Elixir exception modules from Python exception class names.

This enables pattern matching on Python exceptions:

    rescue
      e in SnakeBridge.DynamicException.ValueError ->
        handle_value_error(e)

# `create`
[🔗](https://github.com/nshkrdotcom/snakebridge/blob/v0.14.0/lib/snakebridge/dynamic_exception.ex#L18)

```elixir
@spec create(String.t(), String.t() | nil, keyword()) :: Exception.t()
```

Creates an exception struct from a Python class name and message.

# `get_or_create_module`
[🔗](https://github.com/nshkrdotcom/snakebridge/blob/v0.14.0/lib/snakebridge/dynamic_exception.ex#L38)

```elixir
@spec get_or_create_module(String.t()) :: module()
```

Gets or creates an exception module for a Python class name.

---

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