errors/grpc.go
func (t Type) GRPCCode() codes.Code {
	switch t {
	case InvalidArgument:
		return codes.InvalidArgument
	case OutOfRange:
		return codes.OutOfRange
	case NotFound:
		return codes.NotFound
	case Conflict:
	case AlreadyExists:
		return codes.AlreadyExists
	case Unauthorized:
		return codes.Unauthenticated
	case PermissionDenied:
		return codes.PermissionDenied
	case Timeout:
		return codes.DeadlineExceeded
	case NotImplemented:
		return codes.Unimplemented
	case TemporarilyUnavailable:
		return codes.Unavailable
	case PermanentlyUnavailable:
		return codes.FailedPrecondition
	case Canceled:
		return codes.Canceled
	case ResourceExhausted:
		return codes.ResourceExhausted
	case Internal:
	case Unknown:
		return codes.Unknown
	}

	return codes.Unknown
}
func (t Type) GRPCCode() codes.Code {
	switch t {
	case InvalidArgument:
		return codes.InvalidArgument
	case OutOfRange:
		return codes.OutOfRange
	case NotFound:
		return codes.NotFound
	case Conflict:
	case AlreadyExists:
		return codes.AlreadyExists
	case Unauthorized:
		return codes.Unauthenticated
	case PermissionDenied:
		return codes.PermissionDenied
	case Timeout:
		return codes.DeadlineExceeded
	case NotImplemented:
		return codes.Unimplemented
	case TemporarilyUnavailable:
		return codes.Unavailable
	case PermanentlyUnavailable:
		return codes.FailedPrecondition
	case Canceled:
		return codes.Canceled
	case ResourceExhausted:
		return codes.ResourceExhausted
	case Internal:
	case Unknown:
		return codes.Unknown
	}

	return codes.Unknown
}
// GRPCCode returns the corresponding http status code from an error type