diff --git a/app/Exceptions/Service/Backup/TooManyBackupsException.php b/app/Exceptions/Service/Backup/TooManyBackupsException.php new file mode 100644 index 000000000..a96baed50 --- /dev/null +++ b/app/Exceptions/Service/Backup/TooManyBackupsException.php @@ -0,0 +1,20 @@ +backup_limit || $server->backups()->count() >= $server->backup_limit) { + throw new TooManyBackupsException($server->backup_limit); + } + $previous = $this->repository->getBackupsGeneratedDuringTimespan($server->id, 10); if ($previous->count() >= 2) { throw new TooManyRequestsHttpException(