Initial commit
This commit is contained in:
17
src/Exception/DatabaseException.php
Normal file
17
src/Exception/DatabaseException.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Toalett\Redis\Timeseries\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
class DatabaseException extends RuntimeException
|
||||
{
|
||||
public function __construct($message = "", $code = 0, Throwable $previous = null)
|
||||
{
|
||||
$parts = explode(':', $message);
|
||||
if (count($parts) >= 2) {
|
||||
$message = ucfirst(trim(end($parts)));
|
||||
}
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
}
|
||||
9
src/Exception/InvalidArgumentException.php
Normal file
9
src/Exception/InvalidArgumentException.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Toalett\Redis\Timeseries\Exception;
|
||||
|
||||
use InvalidArgumentException as PhpInvalidArgumentException;
|
||||
|
||||
class InvalidArgumentException extends PhpInvalidArgumentException
|
||||
{
|
||||
}
|
||||
11
src/Exception/KeyNotFoundException.php
Normal file
11
src/Exception/KeyNotFoundException.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Toalett\Redis\Timeseries\Exception;
|
||||
|
||||
class KeyNotFoundException extends RuntimeException
|
||||
{
|
||||
public function __construct(string $key)
|
||||
{
|
||||
parent::__construct(sprintf("Key '{$key}' not found on Redis server"));
|
||||
}
|
||||
}
|
||||
9
src/Exception/RuntimeException.php
Normal file
9
src/Exception/RuntimeException.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Toalett\Redis\Timeseries\Exception;
|
||||
|
||||
use RuntimeException as PhpRuntimeException;
|
||||
|
||||
class RuntimeException extends PhpRuntimeException
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user