Refactored Exceptions
This commit is contained in:
parent
ffdaaebfbc
commit
db47d0fc0e
8 changed files with 67 additions and 14 deletions
|
@ -9,11 +9,10 @@
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param string $message
|
* @param string $message
|
||||||
* @param int $code
|
|
||||||
* @param Throwable|null $previous
|
* @param Throwable|null $previous
|
||||||
*/
|
*/
|
||||||
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
|
public function __construct(string $message = "", ?Throwable $previous = null)
|
||||||
{
|
{
|
||||||
parent::__construct($message, $code, $previous);
|
parent::__construct($message, ($previous ? $previous->getCode() : 0), $previous);
|
||||||
}
|
}
|
||||||
}
|
}
|
17
src/TamerLib/Exceptions/JobManagerException.php
Normal file
17
src/TamerLib/Exceptions/JobManagerException.php
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace TamerLib\Exceptions;
|
||||||
|
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
|
class JobManagerException extends \Exception
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param string $message
|
||||||
|
* @param Throwable|null $previous
|
||||||
|
*/
|
||||||
|
public function __construct(string $message = "", ?Throwable $previous = null)
|
||||||
|
{
|
||||||
|
parent::__construct($message, ($previous ? $previous->getCode() : 0), $previous);
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,11 +9,10 @@
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param string $message
|
* @param string $message
|
||||||
* @param int $code
|
|
||||||
* @param Throwable|null $previous
|
* @param Throwable|null $previous
|
||||||
*/
|
*/
|
||||||
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
|
public function __construct(string $message = "", ?Throwable $previous = null)
|
||||||
{
|
{
|
||||||
parent::__construct($message, $code, $previous);
|
parent::__construct($message, ($previous ? $previous->getCode() : 0), $previous);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,11 +9,10 @@
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param string $message
|
* @param string $message
|
||||||
* @param int $code
|
|
||||||
* @param Throwable|null $previous
|
* @param Throwable|null $previous
|
||||||
*/
|
*/
|
||||||
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
|
public function __construct(string $message = "", ?Throwable $previous = null)
|
||||||
{
|
{
|
||||||
parent::__construct($message, $code, $previous);
|
parent::__construct($message, ($previous ? $previous->getCode() : 0), $previous);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,8 +7,12 @@
|
||||||
|
|
||||||
class ServerException extends Exception
|
class ServerException extends Exception
|
||||||
{
|
{
|
||||||
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
|
/**
|
||||||
|
* @param string $message
|
||||||
|
* @param Throwable|null $previous
|
||||||
|
*/
|
||||||
|
public function __construct(string $message = "", ?Throwable $previous = null)
|
||||||
{
|
{
|
||||||
parent::__construct($message, $code, $previous);
|
parent::__construct($message, ($previous ? $previous->getCode() : 0), $previous);
|
||||||
}
|
}
|
||||||
}
|
}
|
18
src/TamerLib/Exceptions/TamerException.php
Normal file
18
src/TamerLib/Exceptions/TamerException.php
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace TamerLib\Exceptions;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
|
class TamerException extends Exception
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param string $message
|
||||||
|
* @param Throwable|null $previous
|
||||||
|
*/
|
||||||
|
public function __construct(string $message = "", ?Throwable $previous = null)
|
||||||
|
{
|
||||||
|
parent::__construct($message, ($previous ? $previous->getCode() : 0), $previous);
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,11 +9,10 @@
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param string $message
|
* @param string $message
|
||||||
* @param int $code
|
|
||||||
* @param Throwable|null $previous
|
* @param Throwable|null $previous
|
||||||
*/
|
*/
|
||||||
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
|
public function __construct(string $message = "", ?Throwable $previous = null)
|
||||||
{
|
{
|
||||||
parent::__construct($message, $code, $previous);
|
parent::__construct($message, ($previous ? $previous->getCode() : 0), $previous);
|
||||||
}
|
}
|
||||||
}
|
}
|
18
src/TamerLib/Exceptions/WorkerFailedException.php
Normal file
18
src/TamerLib/Exceptions/WorkerFailedException.php
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace TamerLib\Exceptions;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
|
class WorkerFailedException extends Exception
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param string $message
|
||||||
|
* @param Throwable|null $previous
|
||||||
|
*/
|
||||||
|
public function __construct(string $message = "", ?Throwable $previous = null)
|
||||||
|
{
|
||||||
|
parent::__construct($message, ($previous ? $previous->getCode() : 0), $previous);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue