Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Filters throw uncaught exceptions and return improper response code #32

Open
ashireman opened this issue Jan 14, 2015 · 1 comment
Open

Comments

@ashireman
Copy link

When validating the supplied data it's possible for a Filter that is attached to the InputFilter to throw an Exception. If this happens, Apigility will return a status code of 200 and depending on your settings it may show the Exception message or stack trace.

I propose wrapping the

$inputFilter->isValid()

call on https://github.com/zfcampus/zf-content-validation/blob/master/src/ContentValidationListener.php#L216 in a try/catch block, and returning a ApiProblemResponse with a status code of 422 should an Exception be thrown.

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas-api-tools/api-tools-content-validation; a new issue has been opened at laminas-api-tools/api-tools-content-validation#8.

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

No branches or pull requests

2 participants