func IsDeadlineExceeded(err error) bool {
	return HasCode(err, uint32(codes.DeadlineExceeded))
}
IsDeadlineExceeded returns whether the givenerror is context.DeadlineExceeded or of type DeadlineExceeded.
package errors
import (
	"context"
	"google.golang.org/grpc/codes"
)
type coder interface {
	Code() uint32
}
func (e *Error) Code() uint32 {
	if e == nil {
		return 0
	}
	if e.code != 0 && e.code != uint32(codes.Unknown) {
		return e.code
	}
	if e.cause != nil {
		return Code(e.cause)
	}
	return uint32(codes.Unknown)
}
func code(err error) uint32 {
	switch err {
	case context.Canceled:
		return uint32(codes.Canceled)
	case context.DeadlineExceeded:
		return uint32(codes.DeadlineExceeded)
	}
	if c, ok := err.(coder); ok {
		return c.Code()
	}
	if ttnErr, ok := From(err); ok {
		return ttnErr.Code()
	}
	return 0
}
func Code(err error) uint32 {
	if err == nil {
		return uint32(codes.OK)
	}
	if code := code(err); code != 0 {
		return code
	}
	return uint32(codes.Unknown)
}
func HasCode(err error, c uint32) bool {
	return code(err) == c
}
func IsCanceled(err error) bool {
	return HasCode(err, uint32(codes.Canceled))
}
func IsUnknown(err error) bool { return HasCode(err, uint32(codes.Unknown)) }
func IsInvalidArgument(err error) bool { return HasCode(err, uint32(codes.InvalidArgument)) }