Skip to content

Add error response deserialization resilience#44

Merged
davidkallesen merged 2 commits into
mainfrom
hotfix/Error-Response-Deserialization-Resilience
Apr 16, 2026
Merged

Add error response deserialization resilience#44
davidkallesen merged 2 commits into
mainfrom
hotfix/Error-Response-Deserialization-Resilience

Conversation

@davidkallesen

Copy link
Copy Markdown
Collaborator

Summary

  • Fall back to raw string when error response deserialization fails
  • Prevent RestClientDeserializationException on malformed 4xx/5xx bodies
  • Success (2xx) deserialization failures still throw as before

Changes

🐛 Fixes

  • Swallow deserialization errors for error responses (4xx/5xx)
  • Return raw string content as ContentObject on failure
  • Preserve throwing behavior for success (2xx) responses

♻️ Refactoring

  • Inline EndpointResponse construction into return statements

✅ Tests

  • Update test to verify fallback behavior instead of exception
  • Rename test to reflect new expected behavior

📝 Documentation

  • Document error response deserialization resilience in README
  • Add code example showing ProblemDetails fallback scenario

🔧 Configuration

  • Add .claude/settings.local.json to .gitignore

@davidkallesen davidkallesen merged commit 6b2e5b7 into main Apr 16, 2026
4 checks passed
@davidkallesen davidkallesen deleted the hotfix/Error-Response-Deserialization-Resilience branch April 16, 2026 12:41
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.

1 participant