Skip to content

Commit

Permalink
fix: swoft-cloud/swoft/issues/1005 with an code on throw route not fo…
Browse files Browse the repository at this point in the history
…und exception
  • Loading branch information
inhere committed Nov 18, 2019
1 parent 43a5075 commit 7e06afa
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 deletions.
14 changes: 13 additions & 1 deletion src/http-server/src/Exception/MethodNotAllowedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@

namespace Swoft\Http\Server\Exception;

use Throwable;

/**
* Class MethodNotAllowedException
*
* @since 2.0
*/
class MethodNotAllowedException extends HttpServerException
{

/**
* Class constructor.
*
* @param string $message
* @param int $code
* @param Throwable|null $previous
*/
public function __construct($message = '', $code = 405, Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
}
14 changes: 13 additions & 1 deletion src/http-server/src/Exception/NotFoundRouteException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@

namespace Swoft\Http\Server\Exception;

use Throwable;

/**
* Class NotFoundRouteException
*
* @since 2.0
*/
class NotFoundRouteException extends HttpServerException
{

/**
* Class constructor.
*
* @param string $message
* @param int $code
* @param Throwable|null $previous
*/
public function __construct($message = '', $code = 404, Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
}
14 changes: 13 additions & 1 deletion src/tcp-server/src/Exception/CommandNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@

namespace Swoft\Tcp\Server\Exception;

use Throwable;

/**
* Class CommandNotFoundException
*/
class CommandNotFoundException extends TcpServerException
{

/**
* Class constructor.
*
* @param string $message
* @param int $code
* @param Throwable|null $previous
*/
public function __construct($message = '', $code = 404, Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
}
14 changes: 13 additions & 1 deletion src/websocket-server/src/Exception/WsModuleRouteException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@

namespace Swoft\WebSocket\Server\Exception;

use Throwable;

/**
* Class WsModuleRouteException
*
* @since 2.0
*/
class WsModuleRouteException extends WsServerException
{

/**
* Class constructor.
*
* @param string $message
* @param int $code
* @param Throwable|null $previous
*/
public function __construct($message = '', $code = 404, Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
}

0 comments on commit 7e06afa

Please sign in to comment.