You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
operationErr: fmt.Errorf("The disk resource 'projects/foo/disk/bar' is already being used by 'projects/foo/instances/1'"),
154
+
wantErrorCode: "InvalidArgument",
155
+
},
156
+
{
157
+
name: "TemporaryError that wraps googleapi error",
158
+
operationErr: common.NewTemporaryError(codes.Unavailable, &googleapi.Error{Code: http.StatusBadRequest, Message: "User error with bad request"}),
159
+
wantErrorCode: "InvalidArgument",
160
+
},
161
+
{
162
+
name: "TemporaryError that wraps fmt.Errorf, which wraps googleapi error",
163
+
operationErr: common.NewTemporaryError(codes.Aborted, fmt.Errorf("got error: %w", &googleapi.Error{Code: http.StatusBadRequest, Message: "User error with bad request"})),
164
+
wantErrorCode: "InvalidArgument",
165
+
},
166
+
{
167
+
name: "TemporaryError that wraps status error",
168
+
operationErr: common.NewTemporaryError(codes.Aborted, status.Error(codes.InvalidArgument, "User error with bad request")),
169
+
wantErrorCode: "InvalidArgument",
170
+
},
171
+
{
172
+
name: "TemporaryError that wraps multiattach error",
173
+
operationErr: common.NewTemporaryError(codes.Unavailable, fmt.Errorf("The disk resource 'projects/foo/disk/bar' is already being used by 'projects/foo/instances/1'")),
0 commit comments