Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print formatted exception for station watcher #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lsimonson-astranis
Copy link

No description provided.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This pull request enhances error reporting in the StationWatcher class within the OpenHTF framework by adding detailed traceback information to exception logs.

  • Modified openhtf/output/servers/station_server.py to include formatted exception details in the StationWatcher.run() method
  • Improved error visibility by using traceback.format_exception() for comprehensive stack traces
  • Enhanced debugging capabilities for issues occurring in the station watching process
  • Aligned with best practices for error handling and logging in Python applications

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +185 to +187
formatted_exception = traceback.format_exception(
type(error), error, error.__traceback__)
_LOG.error('Error in station watcher: \n',
Copy link

Choose a reason for hiding this comment

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

style: Consider using f-strings for better readability

Suggested change
formatted_exception = traceback.format_exception(
type(error), error, error.__traceback__)
_LOG.error('Error in station watcher: \n',
formatted_exception = traceback.format_exception(
type(error), error, error.__traceback__)
_LOG.error(f'Error in station watcher: \n{''.join(formatted_exception)}')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant