package status

Import Path
	google.golang.org/grpc/internal/status (on go.dev)

Dependency Relation
	imports 7 packages, and imported by 3 packages

Involved Source Files Package status implements errors returned by gRPC. These errors are serialized and transmitted on the wire between server and client, and allow for additional data to be transmitted via the Details field in the status proto. gRPC service handlers should return an error created by this package, and gRPC clients should expect a corresponding error to be returned from the RPC call. This package upholds the invariants that a non-nil error may not contain an OK code, and an OK code must result in a nil error.
Package-Level Type Names (total 2, both are exported)
/* sort exporteds by: | */
Error wraps a pointer of a status proto. It implements error and Status, and a nil *Error should never be returned by this package. (*Error) Error() string GRPCStatus returns the Status represented by se. Is implements future error.Is functionality. A Error is equivalent if the code and message are identical. *Error : error
Status represents an RPC status code, message, and details. It is immutable and should be created with New, Newf, or FromProto. Code returns the status code contained in s. Details returns a slice of details messages attached to the status. If a detail cannot be decoded, the error is returned in place of the detail. If the detail can be decoded, the proto message returned is of the same type that was given to WithDetails(). Err returns an immutable error representing s; returns nil if s.Code() is OK. Message returns the message contained in s. Proto returns s's status as an spb.Status proto message. (*Status) String() string WithDetails returns a new status with the provided details messages appended to the status. If any errors are encountered, it returns nil and the first error encountered. *Status : expvar.Var *Status : fmt.Stringer func FromProto(s *spb.Status) *Status func New(c codes.Code, msg string) *Status func Newf(c codes.Code, format string, a ...any) *Status func NewWithProto(code codes.Code, message string, statusProto []string) *Status func (*Error).GRPCStatus() *Status func (*Status).WithDetails(details ...protoadapt.MessageV1) (*Status, error) func google.golang.org/grpc/internal/transport.(*ClientStream).Status() *status.Status func google.golang.org/grpc/status.Convert(err error) *status.Status func google.golang.org/grpc/status.FromContextError(err error) *status.Status func google.golang.org/grpc/status.FromError(err error) (s *status.Status, ok bool) func google.golang.org/grpc/status.FromProto(s *spb.Status) *status.Status func google.golang.org/grpc/status.New(c codes.Code, msg string) *status.Status func google.golang.org/grpc/status.Newf(c codes.Code, format string, a ...any) *status.Status func IsRestrictedControlPlaneCode(s *Status) bool func RawStatusProto(s *Status) *spb.Status func google.golang.org/grpc/internal/transport.(*ServerStream).WriteStatus(st *status.Status) error
Package-Level Functions (total 8, all are exported)
Err returns an error representing c and msg. If c is OK, returns nil.
Errorf returns Error(c, fmt.Sprintf(format, a...)).
FromProto returns a Status representing s.
IsRestrictedControlPlaneCode returns whether the status includes a code restricted for control plane usage as defined by gRFC A54.
New returns a Status representing c and msg.
Newf returns New(c, fmt.Sprintf(format, a...)).
NewWithProto returns a new status including details from statusProto. This is meant to be used by the gRPC library only.
RawStatusProto returns the internal protobuf message for use by gRPC itself.