fix: token check and error unwrapping (#3648)

* fix: token check and error unwrapping

* remove unused code
This commit is contained in:
Livio Amstutz
2022-05-18 10:49:16 +02:00
committed by GitHub
parent 4ec006dd02
commit 616b31c959
13 changed files with 46 additions and 33 deletions

View File

@@ -38,3 +38,7 @@ func IsErrorAlreadyExists(err error) bool {
_, ok := err.(AlreadyExists)
return ok
}
func (err *AlreadyExistsError) Unwrap() error {
return err.CaosError
}

View File

@@ -40,3 +40,7 @@ func (err *DeadlineExceededError) Is(target error) bool {
}
return err.CaosError.Is(t.CaosError)
}
func (err *DeadlineExceededError) Unwrap() error {
return err.CaosError
}

View File

@@ -40,3 +40,7 @@ func (err *InternalError) Is(target error) bool {
}
return err.CaosError.Is(t.CaosError)
}
func (err *InternalError) Unwrap() error {
return err.CaosError
}

View File

@@ -38,3 +38,7 @@ func (err *InvalidArgumentError) Is(target error) bool {
}
return err.CaosError.Is(t.CaosError)
}
func (err *InvalidArgumentError) Unwrap() error {
return err.CaosError
}

View File

@@ -33,3 +33,7 @@ func (err *NotFoundError) Is(target error) bool {
}
return err.CaosError.Is(t.CaosError)
}
func (err *NotFoundError) Unwrap() error {
return err.CaosError
}

View File

@@ -40,3 +40,7 @@ func (err *PermissionDeniedError) Is(target error) bool {
}
return err.CaosError.Is(t.CaosError)
}
func (err *PermissionDeniedError) Unwrap() error {
return err.CaosError
}

View File

@@ -40,3 +40,7 @@ func (err *PreconditionFailedError) Is(target error) bool {
}
return err.CaosError.Is(t.CaosError)
}
func (err *PreconditionFailedError) Unwrap() error {
return err.CaosError
}

View File

@@ -40,3 +40,7 @@ func (err *UnauthenticatedError) Is(target error) bool {
}
return err.CaosError.Is(t.CaosError)
}
func (err *UnauthenticatedError) Unwrap() error {
return err.CaosError
}

View File

@@ -40,3 +40,7 @@ func (err *UnavailableError) Is(target error) bool {
}
return err.CaosError.Is(t.CaosError)
}
func (err *UnavailableError) Unwrap() error {
return err.CaosError
}

View File

@@ -40,3 +40,7 @@ func (err *UnimplementedError) Is(target error) bool {
}
return err.CaosError.Is(t.CaosError)
}
func (err *UnimplementedError) Unwrap() error {
return err.CaosError
}

View File

@@ -40,3 +40,7 @@ func (err *UnknownError) Is(target error) bool {
}
return err.CaosError.Is(t.CaosError)
}
func (err *UnknownError) Unwrap() error {
return err.CaosError
}