fj pr comment delete: missing comment returns raw error (wrong exit code, no friendly message) #150

Open
opened 2026-06-11 02:41:41 +00:00 by stephen · 0 comments
Owner

Found during the #131 red-CI fix (PR #149).

delete_comment bypasses ensure_success, so deleting a missing comment returns a raw reqwest error instead of an ApiError. Consequences vs edit_comment:

  • No friendly not found: message.
  • error_exit_code can't downcast it, so the process exits EXIT_GENERIC (1) instead of EXIT_NOT_FOUND (3).

Fix: route delete_comment through ensure_success like edit_comment, so the error type, message, and exit code are consistent. Small, behavior-aligning change; add a test for the missing-comment delete path.

Found during the #131 red-CI fix (PR #149). `delete_comment` bypasses `ensure_success`, so deleting a missing comment returns a raw `reqwest` error instead of an `ApiError`. Consequences vs `edit_comment`: - No friendly `not found:` message. - `error_exit_code` can't downcast it, so the process exits `EXIT_GENERIC` (1) instead of `EXIT_NOT_FOUND` (3). Fix: route `delete_comment` through `ensure_success` like `edit_comment`, so the error type, message, and exit code are consistent. Small, behavior-aligning change; add a test for the missing-comment delete path.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rasterstate/fj#150
No description provided.