[Io] Handle Application Exceptions

This commit is contained in:
Chris Boden 2012-05-11 11:59:18 -04:00
parent 5f80c291b7
commit d05cac8b6c

View File

@ -75,11 +75,19 @@ class IoServer {
} }
public function handleData($data, $conn) { public function handleData($data, $conn) {
$this->app->onMessage($conn->decor, $data); try {
$this->app->onMessage($conn->decor, $data);
} catch (\Exception $e) {
$this->handleError($e, $conn);
}
} }
public function handleEnd($conn) { public function handleEnd($conn) {
$this->app->onClose($conn->decor); try {
$this->app->onClose($conn->decor);
} catch (\Exception $e) {
$this->handleError($e, $conn);
}
} }
public function handleError(\Exception $e, $conn) { public function handleError(\Exception $e, $conn) {