fabro/lib/crates/fabro-github
Bryan Helmkamp 7d63e2c298
refactor(github): replace stringly-typed PR errors with typed enum
Introduce PullRequestApiError with a structured NotFound variant and an
Other(String) catch-all for non-classified failures. Update
get_pull_request, merge_pull_request, and close_pull_request to return
the new type so callers can branch on shape rather than substring.

Server PR handlers now match Err(PullRequestApiError::NotFound { .. })
to map a missing GitHub PR to the existing github_pull_request_not_found
ApiError, removing three err.contains("not found") substring checks.

The Display impl for NotFound preserves the prior message format
("Pull request #N not found in owner/repo") so logging and the
catch-all BAD_GATEWAY response keep their human-readable text.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 22:31:23 -04:00
..
src refactor(github): replace stringly-typed PR errors with typed enum 2026-04-23 22:31:23 -04:00
tests refactor(api): unify PR detail types via with_replacement 2026-04-23 21:41:11 -04:00
Cargo.toml refactor(github): replace stringly-typed PR errors with typed enum 2026-04-23 22:31:23 -04:00