Error Handling
Custom Not Found Handler
- Applies to
- Gatewayruntime for API, AI, and MCP gateways
- Hosting
- Managed EdgeManaged DedicatedSelf-Hosted
By default, Zuplo will return a 404 (using
problem details) if no matching path/method combination
is found. You can override this behavior by adding code to the
zuplo.runtime.ts file (see runtime extensions).
For example - a custom not found handler can be used to return a
405 - Method Not Allowed if a matching path is found, but no matching METHOD,
here is an example function that would implement this behavior:
Code
An error in your zuplo.runtime.ts can break your gateway for all requests. Be
sure to carefully review any custom code in this file and add generous error
handling where appropriate.
Last modified on