Block creation of backups if it would put the server over it's limit
This commit is contained in:
parent
f1c3762f4d
commit
446dc8b33d
2 changed files with 28 additions and 0 deletions
20
app/Exceptions/Service/Backup/TooManyBackupsException.php
Normal file
20
app/Exceptions/Service/Backup/TooManyBackupsException.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Exceptions\Service\Backup;
|
||||
|
||||
use Pterodactyl\Exceptions\DisplayException;
|
||||
|
||||
class TooManyBackupsException extends DisplayException
|
||||
{
|
||||
/**
|
||||
* TooManyBackupsException constructor.
|
||||
*
|
||||
* @param int $backupLimit
|
||||
*/
|
||||
public function __construct(int $backupLimit)
|
||||
{
|
||||
parent::__construct(
|
||||
sprintf('Cannot create a new backup, this server has reached its limit of %d backups.', $backupLimit)
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue