Skip to content

fix(controller): Correct error formatting in trial controller package#2629

Open
ruskaruma wants to merge 1 commit intokubeflow:masterfrom
ruskaruma:fix-format-verb-error-wrapping
Open

fix(controller): Correct error formatting in trial controller package#2629
ruskaruma wants to merge 1 commit intokubeflow:masterfrom
ruskaruma:fix-format-verb-error-wrapping

Conversation

@ruskaruma
Copy link

What this PR does / why we need it:
Fixes three error formatting issues in pkg/controller.v1beta1/trial/:

  1. trial_controller_util.go:229 uses %e (scientific notation for floats) instead of %w, producing garbled output like &{%!e(string=...)} on timestamp parse errors.
  2. trial_controller.go:61-63 uses fmt.Errorf() for sentinel errors that are compared with errors.Is(). Changed to errors.New() for immutability.
  3. trial/util/job_util.go:82,103 uses %v instead of %w, which breaks the error chain for errors.Is()/errors.As() callers.

Which issue(s) this PR fixes:
Fixes #2628

Checklist:

  • Docs included if any changes are user facing
    • N/A: internal error handling only, no user facing changes

Signed-off-by: ruskaruma <ishaan.sinha10@gmail.com>
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign gaocegege for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ruskaruma
Copy link
Author

@andreyvelich, can you please review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect error formatting in trial controller package

1 participant