Skip to content

Commit

Permalink
feat: "revert: preserve auth errors in cloudrunner.WrapTransient"
Browse files Browse the repository at this point in the history
This reverts commit d62a6a3.

This commit breaks the API description of only forwarding transient
(retryable) errors.
  • Loading branch information
odsod committed Sep 30, 2024
1 parent 0ebf2af commit 646342a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion clouderror/wrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func WrapTransient(err error, msg string) error {
func WrapTransientCaller(err error, msg string, caller Caller) error {
if s, ok := status.FromError(err); ok {
switch s.Code() {
case codes.Unavailable, codes.DeadlineExceeded, codes.Canceled, codes.Unauthenticated, codes.PermissionDenied:
case codes.Unavailable, codes.DeadlineExceeded, codes.Canceled:
return &wrappedStatusError{status: status.New(s.Code(), msg), err: err, caller: caller}
}
}
Expand Down
10 changes: 0 additions & 10 deletions clouderror/wrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ func Test_WrapTransient(t *testing.T) {
err: status.Error(codes.Unavailable, "transient"),
expectedCode: codes.Unavailable,
},
{
name: "codes.Unauthenticated",
err: status.Error(codes.Unauthenticated, "transient"),
expectedCode: codes.Unauthenticated,
},
{
name: "codes.PermissionDenied",
err: status.Error(codes.PermissionDenied, "transient"),
expectedCode: codes.PermissionDenied,
},
{
name: "wrapped transient",
err: Wrap(
Expand Down

0 comments on commit 646342a

Please sign in to comment.