Documentation ¶
Index ¶
- func Convert(c codes.Code, err error) *status.Status
- func Errore(c codes.Code, err error, details ...proto.Message) error
- func FromError(c codes.Code, err error) (s *status.Status, ok bool)
- func Newe(c codes.Code, err error, details ...proto.Message) *status.Status
- func WithBadRequestDetails(s *status.Status, fields ...errdetails.BadRequest_FieldViolation) *status.Status
- func WithDetails(s *status.Status, details ...proto.Message) *status.Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
Convert is a convenience function which removes the need to handle the boolean return value from FromError.
func FromError ¶
FromError returns a Status representing err if it was produced from this package or has a method `GRPCStatus() *Status`. Otherwise, ok is false and a Status is returned with code.Code and the original error message.
func Newe ¶
Newe returns a Status representing c and error, that is . if err == nil, return codes.OK if err != nil but c == codes.OK, return codes.Internal otherwise, return c
func WithBadRequestDetails ¶
func WithBadRequestDetails(s *status.Status, fields ...errdetails.BadRequest_FieldViolation) *status.Status
WithBadRequestDetails returns a new status with the provided bad requests messages appended to the status.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.