README.md
1# package drpcerr
2
3`import "storj.io/drpc/drpcerr"`
4
5Package drpcerr lets one associate error codes with errors.
6
7## Usage
8
9```go
10const (
11 // Unimplemented is the code used by the generated unimplemented
12 // servers when returning errors.
13 Unimplemented = 12
14)
15```
16
17#### func Code
18
19```go
20func Code(err error) uint64
21```
22Code returns the error code associated with the error or 0 if none is.
23
24#### func WithCode
25
26```go
27func WithCode(err error, code uint64) error
28```
29WithCode associates the code with the error if it is non nil and the code is
30non-zero.
31