Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRpcError ¶
func NewRpcError(code codes.Code, message string, details RpcErrorDetails) error
NewRpcError creates an error with rpc error detail data, to be returned via rpc method call's error field, so that rpc error details can be sent back to the rpc caller client
withDetail = one or more detail proto error types from google.golang.org/genproto/googleapis/rpc/errdetails
Types ¶
type RpcErrorDetails ¶
type RpcErrorDetails struct { RequestInfo *epb.RequestInfo LocalizedMessage *epb.LocalizedMessage ResourceInfo *epb.ResourceInfo RetryInfo *epb.RetryInfo DebugInfo *epb.DebugInfo ErrorInfo *epb.ErrorInfo PreconditionFailure *epb.PreconditionFailure PreconditionFailure_Violation *epb.PreconditionFailure_Violation BadRequest *epb.BadRequest BadRequest_FieldViolation *epb.BadRequest_FieldViolation QuotaFailure *epb.QuotaFailure QuotaFailure_Violation *epb.QuotaFailure_Violation Help *epb.Help Help_Link *epb.Help_Link }
func ConvertToRpcError ¶
func ConvertToRpcError(err error) (*status.Status, RpcErrorDetails)
ConvertToRpcError will convert error object into rpc status and error details
Click to show internal directories.
Click to hide internal directories.