Supabase.HTTPErrorParser (supabase_potion v0.6.1)

The default error parser in case no one is provided via Supabase.Fetcher.with_error_parser/2.

Error parsers should be implement firstly by adjacent services libraries, to handle service-specific error like for authentication or storage, although a final user could easily attach their own custom error parser.

The default error parser define the code and message fields based into the HTTP Status.

The default metadata format is:

%{
  path: "The URL path appended to the base_url in request",
  req_body: "The request body, encoded as iodata or binary",
  resp_body: "The response body as it is",
  # headers is a list of tuples (String.t, String.t)
  # the `authorization` header is removed from it
  headers: []
}

All other fields are filled with the Supabase.Request struct as context, if available.

Summary

Functions

Callback implementation for Supabase.Error.from/2.

Functions

from(resp, ctx)

Callback implementation for Supabase.Error.from/2.