We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Now, annotators cannot be added when generating new error. If we want to generate new error with annotations, we have to do like following.
fail.Wrap(fail.New("hoge"), fail.WithCode(400))
So, I want you to be able to attach annotations with fail.New() and fail.Errorf(), or create another methods.
fail.New()
fail.Errorf()
func New(text string, annotators ...Annotator) error { err := &Error{Err: errors.New(text)} withStackTrace(0)(err) for _, f := range annotators { f(err) } return err } func Errorf(format string, args ...interface{}) error { var fmtArgs []interface{} var annotators []Annotator for _, arg := range args { antt, ok := arg.(Annotator) if ok { annotators = append(annotators, antt) } else { fmtArgs = append(fmtArgs, arg) } } err := &Error{Err: fmt.Errorf(format, fmtArgs...)} withStackTrace(0)(err) for _, f := range annotators { f(err) } return err }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Now, annotators cannot be added when generating new error.
If we want to generate new error with annotations, we have to do like following.
So, I want you to be able to attach annotations with
fail.New()
andfail.Errorf()
, or create another methods.The text was updated successfully, but these errors were encountered: