Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed how Errors are handled #25

Merged
merged 3 commits into from
Jun 19, 2019
Merged

fixed how Errors are handled #25

merged 3 commits into from
Jun 19, 2019

Conversation

thorix
Copy link
Collaborator

@thorix thorix commented May 17, 2019

Errors where double printing part of the message. We found that parseError was being called two times creating this output: 2019-05-17 10:54:03.870426 [ FATAL ] Vault Error: Vault Error: Get...

MessageParts []string
OriginalError error
}

// Error is custom error interface with one method that will block other functions
// from using this Error. This is not interchangeable with the standard error.
type Error interface {
Copy link
Member

Choose a reason for hiding this comment

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

Personally I would change this error name to, could possibly get away with keeping CustomVaultError private customVaultError and then only using the interface everywhere

pkg/vault/error.go Outdated Show resolved Hide resolved
pkg/vault/status.go Outdated Show resolved Hide resolved
@@ -11,7 +11,7 @@ func (v *Vault) GetCurrentTokenTTL() (time.Duration, error) {
// Get the token info from Vault
secret, err := v.client.Auth().Token().LookupSelf()
if err != nil {
return 0, err
return 0, v.parseError(err)
Copy link
Member

Choose a reason for hiding this comment

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

This function should be returning Error not error

@thorix thorix merged commit 3cb9939 into master Jun 19, 2019
@thorix thorix deleted the clean_up_logs branch June 19, 2019 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants