oRPC Customizing Error Response
Installation
SKILL.md
Customizing Error Response Format
By default, OpenAPIHandler, OpenAPIGenerator, and OpenAPILink share the same error response format. You can customize one, some, or all of them.
OpenAPIHandler
Use customErrorResponseBodyEncoder:
const handler = new OpenAPIHandler(router, {
customErrorResponseBodyEncoder(error) {
return error.toJSON()
},
})
Return
nullorundefinedto fallback to the default behavior.