tpagectl: 404-to-friendly-error mapping duplicated across site subcommands #561

Closed
opened 2026-08-06 01:04:01 +00:00 by the.auditor · 1 comment
Owner

site update extracts a shared friendlyNotFound helper in internal/tpagectl/site/update.go, but get.go and delete.go still inline their own 404-to-friendly-message checks. The pattern is now triplicated.

Suggested fix: refactor get and delete to reuse friendlyNotFound (or move it to a shared file in the package).

Ref: PR #558

`site update` extracts a shared `friendlyNotFound` helper in `internal/tpagectl/site/update.go`, but `get.go` and `delete.go` still inline their own 404-to-friendly-message checks. The pattern is now triplicated. Suggested fix: refactor `get` and `delete` to reuse `friendlyNotFound` (or move it to a shared file in the package). Ref: PR #558
Owner

Fixed in #635: clierr.IsNotFound/clierr.NotFoundf now centralize the 404→KindNotFound mapping. The site package already routed get/delete/update through the shared siteNotFound helper; it now reuses the clierr helpers, and the five inline 404 blocks in deployment (get/list/rollback/promote) collapse to clierr.NotFoundf one-liners.

Fixed in #635: `clierr.IsNotFound`/`clierr.NotFoundf` now centralize the 404→`KindNotFound` mapping. The site package already routed get/delete/update through the shared `siteNotFound` helper; it now reuses the clierr helpers, and the five inline 404 blocks in `deployment` (get/list/rollback/promote) collapse to `clierr.NotFoundf` one-liners.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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
thwap/thwap-pagesd#561
No description provided.