Skip to content

Commit

Permalink
Exception types change
Browse files Browse the repository at this point in the history
  • Loading branch information
luzrain committed Sep 18, 2024
1 parent d6986ca commit 89d513d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Exception/AlreadyRunningException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Luzrain\PHPStreamServer\Server;

final class AlreadyRunningException extends \RuntimeException
final class AlreadyRunningException extends \Exception
{
public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/NotRunningException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Luzrain\PHPStreamServer\Server;

final class NotRunningException extends \RuntimeException
final class NotRunningException extends \Exception
{
public function __construct()
{
Expand Down
9 changes: 9 additions & 0 deletions src/Internal/MasterProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ public function addPlugin(Plugin ...$plugins): void
}
}

/**
* @throws AlreadyRunningException
*/
public function run(bool $daemonize = false): int
{
if ($this->isRunning()) {
Expand Down Expand Up @@ -227,6 +230,9 @@ private function onMasterShutdown(): void
}
}

/**
* @throws NotRunningException
*/
public function stop(int $code = 0): void
{
if (!$this->isRunning()) {
Expand Down Expand Up @@ -260,6 +266,9 @@ public function stop(int $code = 0): void
$this->suspension->resume($code);
}

/**
* @throws NotRunningException
*/
public function reload(): void
{
if (!$this->isRunning()) {
Expand Down

0 comments on commit 89d513d

Please sign in to comment.