Rename refresh token errors to list error (#4138)

This commit is contained in:
Todd authored and Johan Brandhorst-Satzkorn committed 2024-01-05 07:43:20 -08:00
1 parent a1bc2be136
commit 2d18f82c9f
9 files changed
+21 -21

No files matched your search

@@ -218,7 +218,7 @@ func backendErrorToApiError(inErr error) *ApiError {
return NotFoundErrorf(genericNotFoundMsg)
case errors.Match(errors.T(errors.AccountAlreadyAssociated), inErr):
return InvalidArgumentErrorf(inErr.Error(), nil)
case errors.Match(errors.T(errors.InvalidRefreshToken), inErr):
case errors.Match(errors.T(errors.InvalidListToken), inErr):
return invalidRefreshTokenError(inErr)
case errors.Match(errors.T(errors.InvalidFieldMask), inErr), errors.Match(errors.T(errors.EmptyFieldMask), inErr):
return InvalidArgumentErrorf("Error in provided request", map[string]string{"update_mask": "Invalid update mask provided."})
@@ -220,14 +220,14 @@ func TestApiErrorHandler(t *testing.T) {
},
},
{
name: "Invalid refresh token error",
err: errors.New(ctx, errors.InvalidRefreshToken, errors.Op("test.op"), "this is a test invalid refresh token error"),
name: "Invalid list token error",
err: errors.New(ctx, errors.InvalidListToken, errors.Op("test.op"), "this is a test invalid list token error"),
expected: ApiError{
Status: http.StatusBadRequest,
Inner: &pb.Error{
Kind: "invalid refresh token",
Kind: "invalid list token",
Op: "test.op",
Message: "this is a test invalid refresh token error",
Message: "this is a test invalid list token error",
},
},
},