pkg / errors

Simple error handling primitives
https://godoc.org/github.com/pkg/errors
BSD 2-Clause "Simplified" License
8.18k stars 691 forks source link

How to change format return wrapped error message #226

Open putrafajarh opened 4 years ago

putrafajarh commented 4 years ago

https://github.com/pkg/errors/blob/614d223910a179a466c1767a985424175c39b465/errors.go#L244

how can i change format return error message, to this

func (w *withMessage) Error() string { return w.cause.Error()+ " | " + w.msg }

puellanivis commented 4 years ago

There is no functionality for this provided. You would have to fork the repo.

SkippyZA commented 4 years ago

You could also create a decorator for this and implement it in your own code without needing to manage a fork