grpcutil

package
v0.0.0-...-b0c7fd6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugInfo

func DebugInfo(err error) *errdetails.DebugInfo

DebugInfo extracts a debug info from an error. If the error is not a gRPC error or does not contain a debug info, it returns nil. In case of multiple debug info, it returns the first one.

func ErrorCode

func ErrorCode(err error) codes.Code

ErrorCode extracts a gRPC error code from an error. If the error is not a gRPC error, it returns codes.Unknown.

func ErrorInfo

func ErrorInfo(err error) *errdetails.ErrorInfo

ErrorInfo extracts an error info from an error. If the error is not a gRPC error or does not contain an error info, it returns nil. In case of multiple error info, it returns the first one.

func IsCanceled

func IsCanceled(err error) bool

IsCanceled is a shortcut for checking if an error is a grpc canceled error. Note that it does not check for context.Canceled, only for gRPC canceled.

func RetryInfo

func RetryInfo(err error) *errdetails.RetryInfo

RetryInfo extracts a retry info from an error. If the error is not a gRPC error or does not contain a retry info, it returns nil. In case of multiple retry info, it returns the first one.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL