Skip to content

Detect and classify relay errors via x-relay-error header #5

@zoedsoupe

Description

@zoedsoupe

Problem

JS checks x-relay-error header to distinguish gateway errors from function errors. Elixir treats all errors generically.

Proposed Solution

{:error, %{type: :relay_error, code: :unauthorized}}  # Gateway issue
{:error, %{type: :http_error, code: :not_found}}     # Function error
{:error, %{type: :network_error}}                     # Connection issue

Benefits

  • Better error diagnosis
  • Distinguish gateway vs function errors
  • Inform retry strategies
  • Feature parity with JS

JS Reference: functions-js/src/FunctionsClient.ts:119-128

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions