Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom error format on api().processError in v4+ #40

Closed
dkreuer opened this issue Oct 19, 2018 · 1 comment
Closed

Custom error format on api().processError in v4+ #40

dkreuer opened this issue Oct 19, 2018 · 1 comment
Assignees
Milestone

Comments

@dkreuer
Copy link
Contributor

dkreuer commented Oct 19, 2018

Is it possible to have custom error format? I need to have error responses in https://tools.ietf.org/html/rfc7807 (Problem Details for HTTP apis) format. This is possible for the actual handlers (GET, POST, ...) by catching errors and handling by myself but is not possible for validation errors (additionally validation stops at first error, it would be nice to validate the whole event and return all validation errors).

Maybe a property error.body which can be generated by the onError hook which will be used instead of generating the body object in processError is sufficient?

@richardhyatt
Copy link
Contributor

Implemented in 4.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants