File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 22
33use GraphQL \Error \Debug ;
44use GraphQL \Error \Error ;
5+ use Rebing \GraphQL \Error \AuthorizationError ;
56use Rebing \GraphQL \Error \ValidationError ;
67use GraphQL \GraphQL as GraphQLBase ;
78use GraphQL \Type \Schema ;
@@ -296,9 +297,13 @@ public static function handleErrors(array $errors, callable $formatter)
296297 foreach ($ errors as $ error ) {
297298 // Try to unwrap exception
298299 $ error = $ error ->getPrevious () ?: $ error ;
299- if ($ error instanceof \Exception && !($ error instanceof ValidationError)) {
300- $ handler ->report ($ error );
300+ // Don't report certain GraphQL errors
301+ if ($ error instanceof ValidationError
302+ || $ error instanceof AuthorizationError
303+ || !($ error instanceof \Exception)) {
304+ continue ;
301305 }
306+ $ handler ->report ($ error );
302307 }
303308 return array_map ($ formatter , $ errors );
304309 }
You can’t perform that action at this time.
0 commit comments