Skip to main content

Module catchers

Module catchers 

Source
Expand description

HTTP error catchers: one consistent, content-negotiated error response across the whole surface, instead of Rocket’s built-in default page.

An agent (a request under /api, or one sending Accept: application/json) gets a JSON { "error", "status" }; a human gets the themed HTML error page (templates/error). The status code is unchanged — only the body shape — so this is the error-path half of the symmetry contract (humans and agents get the same information in their native form).

Functions§

catchers
The catcher set to register on the Rocket instance (server::mount_api_with).