Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Latest commit

 

History

History
25 lines (18 loc) · 599 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 599 Bytes

grpcerrors GoDoc Build Status

Register errors so that they can be safely transmitted over gRPC.

In both client and server:

someError := errors.New("some error")
grpcerrors.Register(1, someError)

In the server:

return nil, grperrors.ToProto(err)

In the client:

_, err := grpcCall()
if grpcerrors.FromProto(err) == someError {
  // ...
}