Skip to content

x-mod/errors

Repository files navigation

errors

Build Status Go Report Card Coverage Status GoDoc

extension of errors for the following features:

  • annotation error
  • error with code, support grpc error code

Quick Start

import "github.com/x-mod/errors"

//annotation error
e1 := errors.Annotate(err, "annotations")
e11 := errors.Annotatef(err, "annotations %s", "format")

//code error
e2 := errors.WithCode(err, errors.ErrNo(100))
//get error's code value
v2 := errors.ValueFrom(e2)