tpagectl: 404-to-friendly-error mapping duplicated across site subcommands #561
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/thwap-pagesd#561
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
site updateextracts a sharedfriendlyNotFoundhelper ininternal/tpagectl/site/update.go, butget.goanddelete.gostill inline their own 404-to-friendly-message checks. The pattern is now triplicated.Suggested fix: refactor
getanddeleteto reusefriendlyNotFound(or move it to a shared file in the package).Ref: PR #558
Fixed in #635:
clierr.IsNotFound/clierr.NotFoundfnow centralize the 404→KindNotFoundmapping. The site package already routed get/delete/update through the sharedsiteNotFoundhelper; it now reuses the clierr helpers, and the five inline 404 blocks indeployment(get/list/rollback/promote) collapse toclierr.NotFoundfone-liners.