Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Support unwrapping NotReadyError #2617

Merged
merged 1 commit into from
Nov 18, 2019
Merged

Support unwrapping NotReadyError #2617

merged 1 commit into from
Nov 18, 2019

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Nov 18, 2019

This error is heavily used by the Helm operator to determine if it
can proceed with a release making use of a git source. It is however
not so easy to only get the reason of failure from the error in it's
existing form, and add our own Helm operator related context to it,
without repeating ourselves.

This commit adds the in Golang 1.13 introduced Unwrap method to the
error, so that the underlying error can be unwrapped from the returned
error on e.g. Status() calls.

https://blog.golang.org/go1.13-errors

This error is heavily used by the Helm operator to determine if it
can proceed with a release making use of a git source. It is however
not so easy to only get the reason of failure from the error in it's
existing form, and add our own Helm operator related context to it,
without repeating ourselves.

This commit adds the in Golang 1.13 introduced `Unwrap` method to the
error, so that the underlying error can be unwrapped from the returned
error on e.g. `Status()` calls.

https://blog.golang.org/go1.13-errors
Copy link
Member

@squaremo squaremo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable.

@hiddeco hiddeco merged commit 6d344f1 into master Nov 18, 2019
@hiddeco hiddeco deleted the enhancement/err-unwrap branch November 18, 2019 10:57
@2opremio 2opremio added this to the 1.16.0 milestone Nov 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants