Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

Use .handler_err() in mutation.rs and query.rs - #20

Merged
shiba4life merged 1 commit into
mainfrom
simplify-handler-error-patterns
Mar 13, 2026
Merged

Use .handler_err() in mutation.rs and query.rs#20
shiba4life merged 1 commit into
mainfrom
simplify-handler-error-patterns

Conversation

@shiba4life

Copy link
Copy Markdown
Collaborator

Summary

  • Replaced 5 verbose match { Ok => ..., Err => HandlerError::Internal(format!(...)) } blocks with flat .handler_err("context")? calls in mutation.rs and query.rs
  • The IntoHandlerError trait already existed in response.rs and was used in other handlers (get_molecule_history, get_atom_content, get_process_results) — this makes the pattern consistent across all handler files
  • Net -19 lines (55 added, 74 removed)

Test plan

  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo check --workspace --features aws-backend passes
  • cargo test --workspace --all-targets passes
  • Regression test with ./run.sh --local --local-schema

🤖 Generated with Claude Code

…mat!(...))

mutation.rs and query.rs had 5 match blocks that manually constructed
HandlerError::Internal(format!(...)) on the Err arm. The IntoHandlerError
trait (defined in response.rs) already provides .handler_err("context")
for exactly this purpose — used consistently in other handlers like
get_molecule_history, get_atom_content, and get_process_results.

Replaces match { Ok => ..., Err => HandlerError::Internal(...) } with
flat .handler_err("context")? calls, reducing nesting and line count.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@shiba4life
shiba4life enabled auto-merge (squash) March 13, 2026 22:45
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@shiba4life
shiba4life merged commit 1aa2a7b into main Mar 13, 2026
4 checks passed
@shiba4life
shiba4life deleted the simplify-handler-error-patterns branch March 13, 2026 22:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant