diff --git a/errors/CHANGELOG.md b/errors/CHANGELOG.md index 434abdce..72b3a738 100644 --- a/errors/CHANGELOG.md +++ b/errors/CHANGELOG.md @@ -2,6 +2,8 @@ ## To be Released +* docs(errors): deprecate use of `errgo` in `ErrCtx` + ## v2.3.0 * feat: add `Is` and `As` to match standard library diff --git a/errors/errctx.go b/errors/errctx.go index 9d014aa2..fc7b8c5b 100644 --- a/errors/errctx.go +++ b/errors/errctx.go @@ -26,13 +26,14 @@ func (err ErrCtx) Unwrap() error { } func New(ctx context.Context, message string) error { - return ErrCtx{ctx: ctx, err: errgo.New(message)} + return ErrCtx{ctx: ctx, err: errors.New(message)} } func Newf(ctx context.Context, format string, args ...interface{}) error { - return ErrCtx{ctx: ctx, err: errgo.Newf(format, args...)} + return Errorf(ctx, format, args...) } +// Deprecated: Use `Wrap` or `Wrapf` instead of `Notef`. The library is able to unwrap mixed errors (wrapped with `errgo` or `github.com/pkg/errors`). func Notef(ctx context.Context, err error, format string, args ...interface{}) error { return ErrCtx{ctx: ctx, err: errgo.Notef(err, format, args...)} }