feat: add app and database modules
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
class BackupOperationException extends RuntimeException
|
||||
{
|
||||
public static function missingBinary(string $binary): self
|
||||
{
|
||||
return new self("Required binary '{$binary}' is not installed on the server.");
|
||||
}
|
||||
|
||||
public static function diskNotConfigured(string $disk): self
|
||||
{
|
||||
return new self("Backup disk '{$disk}' is not configured or unreachable.");
|
||||
}
|
||||
|
||||
public static function restoreFailed(string $reason): self
|
||||
{
|
||||
return new self("Backup restore failed: {$reason}");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
class MonitoringException extends RuntimeException
|
||||
{
|
||||
public static function unsupportedOs(string $os): self
|
||||
{
|
||||
return new self("Monitoring is not implemented for OS family: {$os}");
|
||||
}
|
||||
|
||||
public static function probeFailed(string $probe, string $reason): self
|
||||
{
|
||||
return new self("Probe '{$probe}' failed: {$reason}");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
class SystemConfigException extends RuntimeException
|
||||
{
|
||||
public static function unknownKey(string $key): self
|
||||
{
|
||||
return new self("Unknown system setting key: {$key}");
|
||||
}
|
||||
|
||||
public static function imageUploadFailed(string $key, string $reason): self
|
||||
{
|
||||
return new self("Failed to upload image for setting '{$key}': {$reason}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user