Repository navigation
fix(rest): return 400 only for an invalid cursor - #254
Merged
PromiseFru merged 1 commit intoNov 20, 2026
Merged
Conversation
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
PromiseFru
approved these changes
Nov 20, 2026
PromiseFru
left a comment
Member
There was a problem hiding this comment.
Thank you, this looks good!
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.
Closes #209
The REST app sent every
ValueErrorandNotImplementedErrorto_bad_request_handler, so a server fault such as the wrong SQLCipher key came back as a 400 with the internal message. The handler is now registered forInvalidCursorErroronly, as the issue suggests, and everything else reaches the generic 500 handler. I checked the otherValueErrorraisers a route can reach (server_identity_key,publication_statsgroup_by,db/types) and their inputs are already validated by FastAPI, so they are server faults too.The new test in
tests/api/rest/test_server_keys.pymakes the list route raise the wrong-keyValueErrorand fails with a 400 without the change. ruff, pyright, import-linter and the pytest suite pass locally on Python 3.12 (the only failures are thetests/scriptsshell tests, which fail the same way onstagingon macOS, and the sqlcipher3 engine test, which has no macOS wheel). Nothing to do on deploy.