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

feature(client.go): define error message #132

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

masahiro331
Copy link

@masahiro331 masahiro331 commented Apr 27, 2021

Hi maintainers.

Thank you for great library.
I'd like to handling error log across versions.

e.g.

type logger struct{}

func (logger) Error(msg string, values ...interface{}) {
	// I don't want this implementation
	// if msg == "request failed" {
	// }
	
	// I want to implement this.
	if msg == RequestFailedMsg {
		// doSomething()
	}
	log.Logger.Errorw(msg, values)
}

func main() {
	retryClient := retryablehttp.NewClient()
	retryClient.Logger = logger{}
}

I like this library, Thank you.

@hashicorp-cla
Copy link

hashicorp-cla commented Apr 27, 2021

CLA assistant check
All committers have signed the CLA.

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.

3 participants