Repository navigation
refactor: classify errors once and add NotFound (#1517) - #1524
Merged
Merged
Conversation
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
First item of the round-2 architecture deepening (#1523).
Errorgets aNotFoundvariant andError::class()(BadRequest,NotFound,SecretDetected,Internal). The server answers by class through onecore_errorincontext.rs, replacing seven hand-writtenValidation => 400, else 500arms (PUT /memoryupdate and namespace move, four room handlers,/consolidate/pair). The two handlers that matchedcontains("not found")(POST /doc/move,DELETE /room/delete) read the class instead; the core sites on those two paths (doc_move,delete_room) now returnNotFound.Why
Status policy lived in a dozen places and two of them depended on message text. No HTTP status changes: a missing memory on update and a missing room on rename are still 400 (they stay
Validation, pinned by a test) until the contract with uteke-cloud decides to move them; that is the follow-up. The only visible difference is the text of thePOST /doc/move404, which no longer starts withValidation error:(also in the CLI and MCP text). Refs #1517.Testing
-D warnings, fmt,cargo test --workspacepass;cargo run -p docgenchanges nothinghandlers/error_tests.rs) also pass on an unmodifieddevelopworktree, which shows the statuses did not moveValidation) and 2 server tests