Skip to content

Commit

Permalink
Merge pull request #248 from DUNE-DAQ/plasorak/stack-to-logs
Browse files Browse the repository at this point in the history
Print the stack here too
  • Loading branch information
PawelPlesniak authored Oct 23, 2024
2 parents 1d684d6 + d4806df commit 6227886
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/drunc/broadcast/server/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@ def wrap(obj, request, context):
try:
log.debug('Executing wrapped function')
ret = cmd(obj, request) # we strip the context here, no need for that anymore
except Exception as e:
stack = traceback.format_exc().split("\n")

from drunc.exceptions import DruncException
flag = ResponseFlag.DRUNC_EXCEPTION_THROWN if isinstance(e, DruncException) else ResponseFlag.UNHANDLED_EXCEPTION_THROWN

except Exception as e:
from drunc.utils.utils import print_traceback
print_traceback()

stack = traceback.format_exc().split("\n")
from drunc.exceptions import DruncException
flag = ResponseFlag.DRUNC_EXCEPTION_THROWN if isinstance(e, DruncException) else ResponseFlag.UNHANDLED_EXCEPTION_THROWN
return Response(
name = obj.name,
token = request.token,
Expand Down Expand Up @@ -84,11 +83,10 @@ async def wrap(obj, request, context):

except Exception as e:
stack = traceback.format_exc().split("\n")
from drunc.exceptions import DruncException
flag = ResponseFlag.DRUNC_EXCEPTION_THROWN if isinstance(e, DruncException) else ResponseFlag.UNHANDLED_EXCEPTION_THROWN

from drunc.utils.utils import print_traceback
print_traceback()
from drunc.exceptions import DruncException
flag = ResponseFlag.DRUNC_EXCEPTION_THROWN if isinstance(e, DruncException) else ResponseFlag.UNHANDLED_EXCEPTION_THROWN

yield Response(
name = obj.name,
Expand Down

0 comments on commit 6227886

Please sign in to comment.