errors icon indicating copy to clipboard operation
errors copied to clipboard

How to change format return wrapped error message

Open putrafajarh opened this issue 5 years ago • 2 comments

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 }

putrafajarh avatar Mar 22 '20 11:03 putrafajarh

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

puellanivis avatar Mar 22 '20 18:03 puellanivis

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

SkippyZA avatar Mar 26 '20 16:03 SkippyZA