Skip to content

Error Handling ​

Hibiki maps failures to stable HibikiError codes and returns the code string as the response body.

CodeTypical status
HIBIKI_VERIFICATION_FAILED400
HIBIKI_PARSE_FAILED400
HIBIKI_UNSUPPORTED_EVENT400 when strictEvents: true
HIBIKI_UNSUPPORTED_CONTENT_TYPE415
HIBIKI_PROVIDER_NOT_REGISTERED500
HIBIKI_DUPLICATE_HANDLER500
HIBIKI_HANDLER_FAILED500

Unsupported events ​

Unsupported provider events return 200 by default so providers do not retry endlessly. Enable strictEvents: true to reject them with 400:

ts
const app = new Hibiki({ strictEvents: true }).use(stripe({ secret }))

Handler failures ​

If a registered handler throws, Hibiki responds with 500 and body HIBIKI_HANDLER_FAILED. Unexpected non-HibikiError failures become a generic 500 Internal webhook error without leaking internals.