Prevent reporting exceptions caused by user input. #1661
-
How do I prevent an Exception caused by user input to be reported? For example: the following GraphQL query throws an query {
example(
# Int cannot represent non 32-bit signed integer value: 500000100000
argument: 500000100000
)
} GraphQL\Error\Error I fear adding the exception to the $dontReport section will cause all errors from being reported. # app/Exceptions/Handler.php
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
\GraphQL\Error\Error::class,
]; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Are you using Lighthouse? Lighthouse will catch exceptions thrown during the execution of a query and return them as part of the response. The error handler Client-safe errors are assumed to be something that:
|
Beta Was this translation helpful? Give feedback.
Are you using Lighthouse?
Lighthouse will catch exceptions thrown during the execution of a query and return them as part of the response.
The error handler
Nuwave\Lighthouse\Execution\ReportingErrorHandler
is included in the default configurationand reports non-client-safe errors through the default Laravel exception handler.
Client-safe errors are assumed to be something that:
Thus, they are typically not actionable for server developers.