refactor(cloud/certificate): Migrate final errors to typed vars#2783
refactor(cloud/certificate): Migrate final errors to typed vars#2783robaa12 wants to merge 5 commits intounikraft:stagingfrom
Conversation
Convert non-wrapped final output validation error to a typed package-level error and preserve context via %w wrapping. Signed-off-by: robaa12 <arobaa23@gmail.com>
Convert non-wrapped final output validation error to a typed package-level error and preserve context via %w wrapping. Signed-off-by: robaa12 <arobaa23@gmail.com>
Convert non-wrapped final validation errors in remove to typed package-level errors while preserving existing behavior and %w wrapping. Signed-off-by: robaa12 <arobaa23@gmail.com>
Convert non-wrapped final validation and parse errors to typed package-level errors and keep wrapped operational errors unchanged. Signed-off-by: robaa12 <arobaa23@gmail.com>
|
Hmm, I meant per command block, so in this case |
|
Got it , Just to confirm the implementation direction for both PRs ( Would it be acceptable to centralize typed errors in a dedicated subpackage: The reason for a dedicated subpackage rather than a plain If this looks good, I'll apply the refactor consistently across both PRs. |
Move typed errors to a shared cloud/certificate error package and update subcommands to import this central taxonomy. This keeps errors consistent per command block without introducing package import cycles. Signed-off-by: robaa12 <arobaa23@gmail.com>
|
Hey , @craciunoiuc Went with a Could you please take another look and confirm this matches what you had in mind? |
Prerequisite checklist
Description of changes
This PR is a scoped follow-up for #102 , focused on
internal/cli/kraft/cloud/certificate/*.It migrates non-wrapped final errors to typed package-level errors using
errors.goper touched subpackage.Updated subpackages:
internal/cli/kraft/cloud/certificate/listinternal/cli/kraft/cloud/certificate/getinternal/cli/kraft/cloud/certificate/removeinternal/cli/kraft/cloud/certificate/createWhat changed:
errors.gofiles in each subpackage above.fmt.Errorf("...")returns with typed errors....: %w) unchanged.