Skip to content

Commit

Permalink
feat: add json encoding error helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
erichartline committed Jan 23, 2020
1 parent e0f120f commit f44a438
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion error.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,9 @@ func HandleOauthExchangeError(ctx context.Context, err error) error {
func HandleUserRetrievalError(ctx context.Context, err error) error {
grpc.SetTrailer(ctx, ErrUserRetrieval)
return status.Error(codes.Internal, err.Error())
}
}

func HandleJSONEncodingError(ctx context.Context, err error) error {
grpc.SetTrailer(ctx, ErrJSONEncoding)
return status.Error(codes.Internal, err.Error())
}

0 comments on commit f44a438

Please sign in to comment.