diff --git a/src/Ratchet/Wamp/ServerProtocol.php b/src/Ratchet/Wamp/ServerProtocol.php index 5b8645c..92dbd85 100644 --- a/src/Ratchet/Wamp/ServerProtocol.php +++ b/src/Ratchet/Wamp/ServerProtocol.php @@ -79,8 +79,8 @@ class ServerProtocol implements MessageComponentInterface, WsServerInterface { /** * {@inheritdoc} - * @throws \Exception - * @throws JsonException + * @throws \Ratchet\Wamp\Exception + * @throws \Ratchet\Wamp\JsonException */ public function onMessage(ConnectionInterface $from, $msg) { $from = $this->connections[$from]; diff --git a/src/Ratchet/Wamp/WampServer.php b/src/Ratchet/Wamp/WampServer.php index b4cd88e..d839fb8 100644 --- a/src/Ratchet/Wamp/WampServer.php +++ b/src/Ratchet/Wamp/WampServer.php @@ -39,9 +39,9 @@ class WampServer implements MessageComponentInterface, WsServerInterface { public function onMessage(ConnectionInterface $conn, $msg) { try { $this->wampProtocol->onMessage($conn, $msg); - } catch (Exception $je) { + } catch (Exception $we) { $conn->close(1007); - } catch (\UnexpectedValueException $uve) { + } catch (JsonException $je) { $conn->close(1007); } } diff --git a/tests/unit/Wamp/ServerProtocolTest.php b/tests/unit/Wamp/ServerProtocolTest.php index 3cc44f0..1b423d2 100644 --- a/tests/unit/Wamp/ServerProtocolTest.php +++ b/tests/unit/Wamp/ServerProtocolTest.php @@ -258,7 +258,7 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { * @dataProvider badFormatProvider */ public function testValidJsonButInvalidProtocol($message) { - $this->setExpectedException('\UnexpectedValueException'); + $this->setExpectedException('\Ratchet\Wamp\Exception'); $conn = $this->newConn(); $this->_comp->onOpen($conn);