# `Backplane.Oauth.Error`
[🔗](https://github.com/gsmlg-opt/backplane/blob/v1.10.77/apps/backplane_oauth/lib/backplane/oauth/error.ex#L1)

Backplane OAuth OAuth errors

> __Note__: Intended to follow [OAuth 2.0 errors](https://tools.ietf.org/html/rfc6749#section-5.2). Additional errors are provided as purpose.

# `t`

```elixir
@type t() :: %Backplane.Oauth.Error{
  error:
    :invalid_request
    | :invalid_client
    | :invalid_access_token
    | :invalid_scope
    | :invalid_code
    | :invalid_grant
    | :invalid_resource_owner
    | :login_required
    | :unsupported_grant_type
    | :unknown_error,
  error_description: String.t(),
  format: :query | :fragment | nil,
  redirect_uri: String.t() | nil,
  state: String.t() | nil,
  status: :internal_server_error | :bad_request | :unauthorized
}
```

# `redirect_to_url`

```elixir
@spec redirect_to_url(error :: t()) :: url :: String.t()
```

Returns the URL to be redirected according to error format.

# `with_format`

```elixir
@spec with_format(
  error :: t(),
  request ::
    Backplane.Oauth.CodeRequest.t()
    | Backplane.Oauth.TokenRequest.t()
    | Backplane.Oauth.HybridRequest.t()
) :: t()
```

Returns the OAuth error augmented with the format according to request type.

---

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