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:
parent
a562591900
commit
8eae18f099
1 changed files with 1 additions and 1 deletions
|
|
@ -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))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue