diff --git a/src/TamerLib/Exceptions/ConnectionException.php b/src/TamerLib/Exceptions/ConnectionException.php index af73ab6..c506e46 100644 --- a/src/TamerLib/Exceptions/ConnectionException.php +++ b/src/TamerLib/Exceptions/ConnectionException.php @@ -9,11 +9,10 @@ { /** * @param string $message - * @param int $code * @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); } } \ No newline at end of file diff --git a/src/TamerLib/Exceptions/JobManagerException.php b/src/TamerLib/Exceptions/JobManagerException.php new file mode 100644 index 0000000..b6c5e17 --- /dev/null +++ b/src/TamerLib/Exceptions/JobManagerException.php @@ -0,0 +1,17 @@ +getCode() : 0), $previous); + } + } \ No newline at end of file diff --git a/src/TamerLib/Exceptions/JobNotFoundException.php b/src/TamerLib/Exceptions/JobNotFoundException.php index d1b7919..02d20f6 100644 --- a/src/TamerLib/Exceptions/JobNotFoundException.php +++ b/src/TamerLib/Exceptions/JobNotFoundException.php @@ -9,11 +9,10 @@ { /** * @param string $message - * @param int $code * @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); } } \ No newline at end of file diff --git a/src/TamerLib/Exceptions/NoAvailablePortException.php b/src/TamerLib/Exceptions/NoAvailablePortException.php index feb1573..53f099f 100644 --- a/src/TamerLib/Exceptions/NoAvailablePortException.php +++ b/src/TamerLib/Exceptions/NoAvailablePortException.php @@ -9,11 +9,10 @@ { /** * @param string $message - * @param int $code * @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); } } \ No newline at end of file diff --git a/src/TamerLib/Exceptions/ServerException.php b/src/TamerLib/Exceptions/ServerException.php index 5c7f339..c894279 100644 --- a/src/TamerLib/Exceptions/ServerException.php +++ b/src/TamerLib/Exceptions/ServerException.php @@ -7,8 +7,12 @@ 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); } } \ No newline at end of file diff --git a/src/TamerLib/Exceptions/TamerException.php b/src/TamerLib/Exceptions/TamerException.php new file mode 100644 index 0000000..0518312 --- /dev/null +++ b/src/TamerLib/Exceptions/TamerException.php @@ -0,0 +1,18 @@ +getCode() : 0), $previous); + } + } \ No newline at end of file diff --git a/src/TamerLib/Exceptions/TimeoutException.php b/src/TamerLib/Exceptions/TimeoutException.php index 38b605c..05cee67 100644 --- a/src/TamerLib/Exceptions/TimeoutException.php +++ b/src/TamerLib/Exceptions/TimeoutException.php @@ -9,11 +9,10 @@ { /** * @param string $message - * @param int $code * @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); } } \ No newline at end of file diff --git a/src/TamerLib/Exceptions/WorkerFailedException.php b/src/TamerLib/Exceptions/WorkerFailedException.php new file mode 100644 index 0000000..ec94f3d --- /dev/null +++ b/src/TamerLib/Exceptions/WorkerFailedException.php @@ -0,0 +1,18 @@ +getCode() : 0), $previous); + } + } \ No newline at end of file