Skip to main content

Module error_page

Module error_page 

Source
Expand description

The error-page node — replaces the body and content type of gateway-generated error responses (404, 500, 502, 503) with configured pages. Port of APISIX’s error-page plugin (response-phase: place after upstream, before client).

Deviations from APISIX:

  • APISIX configures the pages via plugin metadata (with an enable flag); featherbit has no metadata tier, so the pages live directly in the node config and placing the node in the graph is the enable switch.
  • APISIX only intercepts responses whose source is not the upstream (get_response_source(ctx) ~= "upstream"). featherbit’s equivalent heuristic is Context.errors being non-empty — a response produced by the gateway (error-handler, auth rejection, …) always carries the error record that routed it there, while a clean upstream response does not. An upstream’s own 502 therefore passes through untouched, exactly as in APISIX.

Structs§

ErrorPage 🔒
One configured error page.
ErrorPagePlugin
Replaces Context.response.body and content-type when the response was generated by the gateway (heuristic: Context.errors non-empty) and its status code has a configured page. All other responses pass through unchanged. This plugin never fails at execution time.

Constants§

SUPPORTED_STATUS 🔒
The status codes APISIX’s error-page supports (its metadata schema hardcodes error_404 / error_500 / error_502 / error_503).

Functions§

default_body 🔒
The default page body, mirroring APISIX’s err_body template (with the gateway’s own name in the footer).