Skip to content

Conversation

@Will-Cross1
Copy link
Contributor

@Will-Cross1 Will-Cross1 commented Apr 4, 2024

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 - ========================================

changed the unexpected logging to use log.exception

this traces back the error to the line in the code
@Will-Cross1 Will-Cross1 requested a review from a team as a code owner April 4, 2024 13:37
Copy link
Member

@Sae126V Sae126V left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I see we are trying to capture the traceback information.

@tofu-rocketry
Copy link
Member

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 tofu-rocketry self-assigned this Apr 4, 2024
@tofu-rocketry tofu-rocketry added this to the 3.4.1 milestone Apr 4, 2024
@tofu-rocketry
Copy link
Member

Added an issue for Docker: #315

@tofu-rocketry tofu-rocketry merged commit 6646436 into apel:dev Apr 4, 2024
@Will-Cross1 Will-Cross1 deleted the Update-unexpected-exception-295 branch April 9, 2024 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Update unexcepted exception handling to log full traceback

3 participants