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

feat: improve gateway response error logging #34

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

roderickvd
Copy link
Owner

Description

Enhance error handling when parsing gateway responses fails by:

  • Adding trace logging of JSON structure when type parsing fails
  • Adding error logging with raw response body when JSON parsing fails

Related Issues

This will help diagnose #31 and similar issues in the future.

Implementation Details

When strongly typed JSON deserialization fails, the code attempts to:

  1. Deserialize as generic JSON for structural debugging
  2. If that fails, log the raw response body as a trace message

Testing

Tested locally by simulating JSON deserialization errors.

Due Diligence

Please confirm that you have completed the following tasks by checking the boxes:

  • I have linked any related issues or feature requests.
  • I have selected the appropriate labels for this pull request.
  • I have performed cross-platform testing if possible.
  • I have updated the CHANGELOG.md file with a summary of my changes under the "Unreleased" section.
  • I have kept the pull request as a draft until it is ready for review (if applicable).
  • I have read and understood the Contributing guidelines.

Enhance error handling when parsing gateway responses fails by:
- Adding trace logging of JSON structure when type parsing fails
- Adding error logging with raw response body when JSON parsing fails
@roderickvd roderickvd added the enhancement New feature or request label Nov 25, 2024
@roderickvd roderickvd self-assigned this Nov 25, 2024
@roderickvd roderickvd mentioned this pull request Nov 25, 2024
6 tasks
@roderickvd roderickvd merged commit 048b503 into main Nov 25, 2024
4 checks passed
@roderickvd roderickvd deleted the feat/gateway-error-logging branch November 25, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant