Files
Joe ElliottandGitHub 361c8f7e5e Fix GRPC/HTTP/TLS (#3300)
* first pass - working

Signed-off-by: Joe Elliott <[email protected]>

* refactor

Signed-off-by: Joe Elliott <[email protected]>

* working?

Signed-off-by: Joe Elliott <[email protected]>

* vendor

Signed-off-by: Joe Elliott <[email protected]>

* integration test

Signed-off-by: Joe Elliott <[email protected]>

* updated go.mod to latest

Signed-off-by: Joe Elliott <[email protected]>

* cleanup

Signed-off-by: Joe Elliott <[email protected]>

* changelog

Signed-off-by: Joe Elliott <[email protected]>

* lint

Signed-off-by: Joe Elliott <[email protected]>

* update servless mods

Signed-off-by: Joe Elliott <[email protected]>

* satisfy interface updates

Signed-off-by: Joe Elliott <[email protected]>

* lint

Signed-off-by: Joe Elliott <[email protected]>

---------

Signed-off-by: Joe Elliott <[email protected]>
2024-01-17 13:33:12 -05:00

38 lines
678 B
Go

package cancellation
import (
"context"
"fmt"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
type cancellationError struct {
inner error
}
func NewError(err error) error {
return cancellationError{err}
}
func NewErrorf(format string, args ...any) error {
return NewError(fmt.Errorf(format, args...))
}
func (e cancellationError) Error() string {
return "context canceled: " + e.inner.Error()
}
func (e cancellationError) Is(err error) bool {
return err == context.Canceled
}
func (e cancellationError) Unwrap() error {
return e.inner
}
func (e cancellationError) GRPCStatus() *status.Status {
return status.New(codes.Canceled, e.Error())
}