docs: show unwrap() with throwOnError true and false - #198
Conversation
… and false Adds examples of how unwrap() throws differently for the two settings: a ResponseError by default, the bare error body with throwOnError: false. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016J52n2bJ25eu2G7eXm7gAL
◈ PR Lens
Architecture 1 component touched across 1 lane. Data flow No data-flow sequence changed in this PR. Drill down
|
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎯 Changes
The "Unwrap the success body" section only showed the default
throwOnError: truecase. It never showed whatunwrap()does withthrowOnError: false, so it's now split into two examples:throwOnError: true:unwrap()throws the sameResponseErrora plainawaitwould.throwOnError: false: the call resolves instead, sounwrap()rejects on its own, throwing the bare parsed error body, not aResponseError.Error handling also gets a one-line cross-reference back to this section.
✅ Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_016J52n2bJ25eu2G7eXm7gAL
Generated by Claude Code