Documentation ¶
Overview ¶
Package status implements errors returned by MachineAPIs. MachineAPIs service handlers should return an error created by this package, and machineAPIs 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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status implements error and Status,
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 codes.Unknown and the original error message.
func WrapError ¶ added in v0.50.0
WrapError creates an instance of status.Status wrapping the underlying cause along with the code and custom error message.
func (*Status) Error ¶
Error returns the error message for the status. WARNING: There is an unwritten contract for anyone using status.Status. One MUST never change the message text. It expects error code to be in the first square brackets and error message in the next. Therefore, any change made here should never change that. Any square brackets added after code and error are ignored when parsing.