fix: Replace .expect() panics with error propagation#107
Conversation
print_response() and several command handlers used .expect() for JSON serialization, which would panic on failure. Changed print_response() to return Result<(), CliError> and replaced all .expect() calls with ? operator, leveraging the existing CliError::Json variant for proper error propagation through the call chain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
Summary
print_response()from returning()toResult<(), CliError>, replacing.expect()calls with?operator.expect()panic sites inoutput.rs,prompt.rs, andgrid.rsthat could crash the CLI on JSON serialization failureCliError::JsonvariantTest plan
cargo build— clean compilationcargo test— all 312 tests pass (70 CLI + 231 core + 11 engine)cargo clippy --all-targets— zero warningscargo fmt --all— formatting verified🤖 Generated with Claude Code