Skip to content

Commit

Permalink
Purge return status fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Snider authored Mar 31, 2023
1 parent aad7ea3 commit 9c1eaab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/purge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ function purgeZone(zoneId: string, zoneKey: string) {
"AccessKey": zoneKey,
}
}).then(response => {
if (response.status === 200) {
info(`Cache purged`);
if (response.status === 204) {
info('The cache was successfuly purged');
}else if (response.status === 401) {
info(`Auth failed`);
info('The request authorization failed');
}else if (response.status === 404) {
info(`Invalid zoneId`);
info('The Pull Zone with the requested ID does not exist');
} else {
throw new Error(`Error purging cache ${response.status}.`);
}
Expand Down

0 comments on commit 9c1eaab

Please sign in to comment.