Skip to content

Commit

Permalink
fix: correctly handle backup rate limits
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Song <[email protected]>
  • Loading branch information
ferothefox committed Oct 16, 2024
1 parent 2f01178 commit 47469f6
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions apps/frontend/src/pages/servers/manage/[id]/backups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,22 @@ const createBackup = async () => {
type: "success",
});
} catch (error) {
backupError.value = error instanceof Error ? error.message : String(error);
addNotification({
group: "server",
title: "Error creating backup",
text: backupError.value,
type: "error",
});
if (error instanceof PyroFetchError && error.statusCode === 429) {
addNotification({
group: "server",
title: "Error creating backup",
text: "Please wait a few moments before creating another backup.",
type: "error",
});
} else {
backupError.value = error instanceof Error ? error.message : String(error);
addNotification({
group: "server",
title: "Error creating backup",
text: backupError.value,
type: "error",
});
}
} finally {
isCreatingBackup.value = false;
}
Expand Down

0 comments on commit 47469f6

Please sign in to comment.