Skip to content

Commit

Permalink
improve wording for missing token error
Browse files Browse the repository at this point in the history
  • Loading branch information
gergoabraham committed Nov 27, 2023
1 parent 58bd53b commit e9f6f0b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,9 @@ describe('UninstallTokenService', () => {
it('rejects if any of the tokens is missing', async () => {
await expect(
uninstallTokenService.checkTokenValidityForAllPolicies()
).rejects.toThrowError('Uninstall Token is missing the token.');
).rejects.toThrowError(
'Invalid uninstall token: Saved object is missing the `token` attribute.'
);
});
});

Expand All @@ -544,7 +546,9 @@ describe('UninstallTokenService', () => {
it('rejects if token is missing', async () => {
await expect(
uninstallTokenService.checkTokenValidityForPolicy(missingTokensPolicyId)
).rejects.toThrowError('Uninstall Token is missing the token.');
).rejects.toThrowError(
'Invalid uninstall token: Saved object is missing the `token` attribute.'
);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,9 @@ export class UninstallTokenService implements UninstallTokenServiceInterface {

private assertToken(attributes: UninstallTokenSOAttributes | undefined) {
if (!attributes?.token && !attributes?.token_plain) {
throw new UninstallTokenError('Uninstall Token is missing the token.');
throw new UninstallTokenError(
'Invalid uninstall token: Saved object is missing the `token` attribute.'
);
}
}

Expand Down

0 comments on commit e9f6f0b

Please sign in to comment.