Skip to content

fix(https_fn): pass message to HttpsError super().__init__ (fixes #314) - #315

Open
Aayush99910 wants to merge 2 commits into
firebase:mainfrom
Aayush99910:fix-httpserror-message
Open

Aayush99910 wants to merge 2 commits into
firebase:mainfrom
Aayush99910:fix-httpserror-message

Conversation

@Aayush99910

Copy link
Copy Markdown

Description

HttpsError.__init__ stores self.message but calls super().__init__() with no arguments. As a result, str(err) returns '' and err.args is (), so logging the exception prints no message.

This PR passes message to super().__init__(message) so it's preserved on the base Exception.

Testing

Added test_https_error_passes_message_to_super which asserts str(err) and err.args contain the message. All 137 tests pass.

Fixes #314

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates HttpsError to pass the error message to its superclass initializer, ensuring that str(err) and err.args correctly contain the message, and adds a corresponding unit test. The review feedback recommends addressing minor PEP 8 and PEP 257 style issues in the new test, such as trailing whitespace, docstring formatting, and a missing newline at the end of the file.

Comment thread tests/test_https_fn.py Outdated
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.

HttpsError.__init__ does not pass message to super().__init__()

1 participant