Skip to content

Conversation

@Linchin
Copy link
Contributor

@Linchin Linchin commented Oct 20, 2025

see internal bug 448976223

TODO:

  • add test
  • match the exception string so we don't catch unexpected cases

@Linchin Linchin requested review from a team as code owners October 20, 2025 23:37
try:
return json.loads(body_str)
except (json.JSONDecodeError, TypeError):
except (json.JSONDecodeError, TypeError, ValueError):
Copy link
Contributor

Choose a reason for hiding this comment

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

ValueError will catch json.JSONDecodeError as well. We can remove it since we're adding a base exception.

ohmayr
ohmayr previously approved these changes Oct 24, 2025
@Linchin Linchin added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Oct 30, 2025
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Oct 30, 2025
@Linchin Linchin enabled auto-merge (squash) October 30, 2025 00:35
@Linchin Linchin disabled auto-merge October 30, 2025 04:34
@Linchin Linchin added owlbot:ignore instruct owl-bot to ignore a PR owlbot:run Add this label to trigger the Owlbot post processor. and removed owlbot:ignore instruct owl-bot to ignore a PR labels Oct 30, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 30, 2025
@Linchin Linchin merged commit b074cad into googleapis:main Oct 30, 2025
13 checks passed
Linchin pushed a commit that referenced this pull request Oct 30, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.42.1](v2.42.0...v2.42.1)
(2025-10-30)


### Bug Fixes

* Catch ValueError for json.loads()
([#1842](#1842))
([b074cad](b074cad))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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