fix: log client-safe exceptions at ERROR instead of CRITICAL (#1193) - #1248
Open
ousamabenyounes wants to merge 1 commit into
Open
fix: log client-safe exceptions at ERROR instead of CRITICAL (#1193)#1248ousamabenyounes wants to merge 1 commit into
ousamabenyounes wants to merge 1 commit into
Conversation
ErrorLoggerListener only special-cased UserError and UserWarning; every other exception fell through to LogLevel::CRITICAL. A client-safe exception such as ArgumentsValidationException (implements ClientAware with isClientSafe() === true) is a client fault, not an internal server error, yet it was logged as CRITICAL and polluted error logs. Add a branch that treats any ClientAware exception marked client-safe like a UserError: log its previous cause (if any) at ERROR and never at CRITICAL. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ousamabenyounes
force-pushed
the
fix/issue-1193
branch
from
August 10, 2026 14:39
5a8fc03 to
92722fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ErrorLoggerListeneronly special-casesUserErrorandUserWarning; every otherexception falls through to
LogLevel::CRITICAL:ArgumentsValidationExceptionimplementsGraphQL\Error\ClientAwareand returnstruefrom
isClientSafe(), so it is a client fault (an invalid input), not an internalserver error. It was nonetheless logged as
CRITICAL, polluting error logs for what isroutine input validation.
Fix
Add a branch, after the
UserError/UserWarningchecks and before theCRITICALfallthrough, that treats any client-safe
ClientAwareexception like aUserError:log its previous cause (if any) at
ERROR, and never atCRITICAL.UserErrorandUserWarning(alsoClientAware) keep their existing, more specifichandling because they are matched earlier. A
ClientAwareexception withisClientSafe() === falsestill falls through toCRITICAL.Test verification (RED → GREEN)
Two data-provider cases added to
ErrorLoggerListenerTestforArgumentsValidationException(with and without a previous cause).RED — on the unmodified branch (fix reverted, tests only), both cases hit the
CRITICALfallthrough:GREEN — with the fix:
Full suite is iso-baseline (the 5 pre-existing
GraphDumpSchemaCommandTestfailures onmasterare unrelated and unchanged):Tests: 714, Failures: 5.