Skip to content

fix: create dict for missing exception #222

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

Merged
merged 2 commits into from
Jun 9, 2025

Conversation

rabidpraxis
Copy link
Contributor

Partially fixes #221

This reverts back to the previous way we dealt with a missing exception.

This reverts back to the previous way we dealt with a missing exception
@rabidpraxis rabidpraxis requested review from roelbondoc and Copilot June 6, 2025 18:18
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reverts the behavior for handling missing exceptions, ensuring that an exception dictionary is properly created when no exception is provided. Key changes include:

  • Adding a new test case (test_notify_with_error_message_only) to cover scenarios where only an error message is provided.
  • Updating the _process_exception logic in notice.py to always create an exception dict containing both error_class and error_message.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
honeybadger/tests/test_core.py New test verifies payload format when error_message is provided only.
honeybadger/notice.py Adjusted exception processing to revert to prior behavior.
Comments suppressed due to low confidence (1)

honeybadger/notice.py:22

  • Review the updated condition to ensure that always including error_message in context (when an exception exists) is the intended behavior. Clarifying inline documentation for this change could help future maintainers.
if self.exception and self.error_message:

Copy link
Contributor

@roelbondoc roelbondoc left a comment

Choose a reason for hiding this comment

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

👍

@rabidpraxis rabidpraxis merged commit 43c804a into master Jun 9, 2025
35 checks passed

def test_payload(request):
payload = json.loads(request.data.decode("utf-8"))
# This demonstrates the current bug - NoneType class and None message
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like a stray comment?

@benjaoming
Copy link
Contributor

Thanks for looking into this!

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.

Exception messages disappeared after upgrade to 0.23.1
3 participants