Skip to content

How to listen/log/catch validation errors? #33371

Answered by devcircus
willsmanley asked this question in General
Discussion options

You must be logged in to vote

It's not generally a good idea to report validation exceptions, especially for high traffic apps. They are included in the frameworks internal "dontreport" array. They're converted to responses as that is the usual use-case. However, all exceptions pass through your app's exception handler. So just check for validation exceptions and do what you need before sending it on to the parent class.

If you're using form requests, you could also change the behavior there, or in a parent/trait of form requests, if you want.

The exception handler is at app\Exceptions\Handler.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@willsmanley
Comment options

@Wulfheart
Comment options

Answer selected by willsmanley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants