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
enableflag); 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 isContext.errorsbeing non-empty — a response produced by a node that failed (upstream connection error, a failed IdP callout, the error-handler that rendered it) 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.
§Outcome exits are not replaced
gateway_generated keys on the presence of an error record, so this
node does not touch responses that arrived on an outcome port — a
denied 403, a limited 429, a broken 503, an abort. Those are
deliberate, already-formed responses and carry no error record. They also
do not normally pass through here at all: an outcome port is wired straight
to client. To style them, wire that port through a response-shaping node
(response-rewrite, or exit-transformer with always: true) on its way
to client instead of expecting error-page to catch them.
Structs§
- Error
Page 🔒 - One configured error page.
- Error
Page Plugin - Replaces
Context.response.bodyandcontent-typewhen the response was generated by the gateway (heuristic:Context.errorsnon-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_bodytemplate (with the gateway’s own name in the footer).