apel / ssm

Secure STOMP Messenger.
apel.github.io
Apache License 2.0
11 stars 24 forks source link

Changed the unexpected log.error to use log.exception #314

Closed Will-Cross1 closed 5 months ago

Will-Cross1 commented 5 months ago

Resolves #295

this traces back the error to the line in the code

Before:

2024-04-04 15:43:27,858 - ssmsend - INFO - ========================================
2024-04-04 15:43:27,858 - ssmsend - INFO - Starting sending SSM version 3.4.0.
2024-04-04 15:43:27,858 - ssmsend - INFO - Setting up SSM with protocol: AMS
SSM failed to complete successfully.  See log file for details.
2024-04-04 15:43:27,858 - ssmsend - ERROR - Unexpected exception in SSM: msg
2024-04-04 15:43:27,858 - ssmsend - ERROR - Exception type: <class 'ValueError'>
2024-04-04 15:43:27,858 - ssmsend - INFO - SSM has shut down.
2024-04-04 15:43:27,858 - ssmsend - INFO - ========================================

After:

2024-04-04 15:44:13,693 - ssmsend - INFO - ========================================
2024-04-04 15:44:13,693 - ssmsend - INFO - Starting sending SSM version 3.4.0.
2024-04-04 15:44:13,693 - ssmsend - INFO - Setting up SSM with protocol: AMS
SSM failed to complete successfully.  See log file for details.
2024-04-04 15:44:13,693 - ssmsend - ERROR - Unexpected exception in SSM. See traceback below.
Traceback (most recent call last):
  File "~/DCIG/ssm/ssm/agents.py", line 192, in run_sender
    raise ValueError("msg")
ValueError: msg
2024-04-04 15:44:13,693 - ssmsend - INFO - SSM has shut down.
2024-04-04 15:44:13,693 - ssmsend - INFO - ========================================
tofu-rocketry commented 5 months ago

I see we are trying to capture the traceback information.

Yeah, there are situations where just the error message itself isn't informative enough.

tofu-rocketry commented 5 months ago

Added an issue for Docker: https://github.com/apel/ssm/issues/315