Refactor Sentry Middleware for Graphene

This commit is contained in:
Lorenz Padberg 2023-12-11 15:36:52 +01:00 committed by Ramon Wenger
parent 4e7dceb8c3
commit 954ed9027d
1 changed files with 7 additions and 1 deletions

View File

@ -120,4 +120,10 @@ class SentryMiddleware(object):
raise error
def resolve(self, next, root, info: ResolveInfo, **args):
return next(root, info, **args).catch(self.on_error)
try:
return next(root, info, **args)
except Exception as e:
capture_exception(e)
raise e