Fixes: 1) Correct conditional check for error types in middleware logging.

Extra: Refactor exception handling for improved clarity and robustness.
This commit is contained in:
Egor Pavlovich Gorbunov 2025-07-07 19:14:31 +03:00
parent a562591900
commit 8eae18f099

View file

@ -106,7 +106,7 @@ class GrapheneLoggingErrorsDebugMiddleware:
try: try:
return next(root, info, **args) return next(root, info, **args)
except Exception as e: except Exception as e:
if e in self.WARNING_ONLY_ERRORS: if any(isinstance(e, error_type) for error_type in self.WARNING_ONLY_ERRORS):
logger.warning(str(e)) logger.warning(str(e))
else: else:
logger.error(str(e)) logger.error(str(e))