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

bug-1935274: increase message length for BugzillaRestHTTPUnexpectedError #6833

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

relud
Copy link
Member

@relud relud commented Dec 9, 2024

100 characters wasn't enough information to understand the error, so doubling it.

@relud relud requested a review from a team as a code owner December 9, 2024 17:16
@relud relud force-pushed the relud-bug-1935274-bugzilla-unexpected branch from af16857 to a8337e7 Compare December 9, 2024 17:40
# it, so let's dump to a string and truncate that to 100 characters.
payload_data = response.content[:100]
# it, so let's dump to a string and truncate that to 200 characters.
payload_data = response.content[:200]
Copy link
Member Author

@relud relud Dec 9, 2024

Choose a reason for hiding this comment

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

in sentry we can see that response.content is a bytes and not a string. I tried adding a .decode("utf8") here, but found out that in tests we mock it as a string. I decided the test is close enough and to leave it as is, rather than try to modify the test.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's my bad. I should remember that .content returns a bytes. It gets !r later, so it doesn't need to be a string. We could fix the mocked test to make it a bytes.

Copy link
Contributor

Choose a reason for hiding this comment

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

There's also response.text, which is the same as .content, but decoded to a Unicode string.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't switch to .text here. I think we want to know what the payload is and avoid additional transforms that can kick up other issues.

@relud relud added this pull request to the merge queue Dec 10, 2024
Merged via the queue into main with commit 4e6d51c Dec 10, 2024
1 check passed
@relud relud deleted the relud-bug-1935274-bugzilla-unexpected branch December 10, 2024 16:17
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.

3 participants