# `Assent.HTTPAdapter.RequestError`
[🔗](https://github.com/pow-auth/assent/blob/v0.4.0/lib/assent/http_adapter.ex#L87)

An exception for when a provider rejects an HTTP request.

The `:response` field is omitted from `Inspect` output as it may contain
sensitive data.

## Fields

  * `:message` - a description of the error
  * `:response` - the normalized HTTP response

## Examples

    iex> error = %Assent.HTTPAdapter.RequestError{
    ...>   message: "Request failed",
    ...>   response: %Assent.HTTPAdapter.HTTPResponse{
    ...>     request: %Assent.HTTPAdapter.HTTPRequest{method: :get, url: "https://example.com"},
    ...>     http_adapter: Assent.HTTPAdapter.Httpc,
    ...>     status: 500,
    ...>     body: "Internal Server Error"
    ...>   }
    ...> }
    iex> Exception.message(error)
    "Request failed\n\nHTTP adapter: Assent.HTTPAdapter.Httpc\nRequest: GET https://example.com\nResponse status: 500\n"
    iex> inspect(error)
    "#Assent.HTTPAdapter.RequestError<message: \"Request failed\", ...>"

# `t`

```elixir
@type t() :: %Assent.HTTPAdapter.RequestError{
  __exception__: term(),
  message: binary(),
  response: Assent.HTTPAdapter.HTTPResponse.t()
}
```

---

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