feat(edda-serve): differentiate HTTP error codes (GH-379)#384
Conversation
…H-379) Add ServiceUnavailable (503) and NotImplemented (501) variants to AppError. Classify open_ledger() errors at the choke point: "not an edda workspace" maps to 404, "database is locked" maps to 503, chronicle-not-enabled maps to 501, and missing snapshot events map to 404 instead of 500. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code Review: PR #384SummaryProperly differentiates HTTP error codes for FindingsBlockersNone. Suggestions
Four-Point Check
VerdictLGTM Reviewed by edda AI |
Code Review: PR #384 (Round 1)SummaryThis PR adds Key FindingsCritical Issues (P0)None. High Priority (P1)
Testing ReviewCoverage
Convention Compliance
Testing Verdict: AdequateVerdict: Changes RequestedFixing P1 issue and will re-review. Round 1 of automated review-fix loop |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code Review: PR #384 (Round 2) — LGTM 🎉All P0 and P1 issues have been resolved. SummaryThis PR correctly differentiates HTTP error codes for ledger failures in
Round 1 fix applied: Test Coverage
Verdict: LGTM ✅No critical or high-priority issues remaining. This PR is ready for merge. Completed after 2 round(s) of automated review-fix loop |
Summary
ServiceUnavailable(503) andNotImplemented(501) variants toAppErrorenumopen_ledger()errors at the choke point viaclassify_open_error()helper:Retry-After: 1header (was 500)reconstruct_snapshotreturns 404 (was 500)use anyhow::Contextimports from 10 handler modulesTest plan
classify_open_errorunit tests: workspace-not-found → NotFound, database-locked → ServiceUnavailable, unknown → Internal/api/statuson bare directory returns 404/api/recapwithout chronicle returns 501ServiceUnavailableresponse includesRetry-After: 1headercargo clippyandcargo fmt --checkcleanCloses #379
🤖 Generated with Claude Code