[Io] Handle Application Exceptions
This commit is contained in:
parent
5f80c291b7
commit
d05cac8b6c
@ -75,11 +75,19 @@ class IoServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function handleData($data, $conn) {
|
public function handleData($data, $conn) {
|
||||||
|
try {
|
||||||
$this->app->onMessage($conn->decor, $data);
|
$this->app->onMessage($conn->decor, $data);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->handleError($e, $conn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleEnd($conn) {
|
public function handleEnd($conn) {
|
||||||
|
try {
|
||||||
$this->app->onClose($conn->decor);
|
$this->app->onClose($conn->decor);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->handleError($e, $conn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleError(\Exception $e, $conn) {
|
public function handleError(\Exception $e, $conn) {
|
||||||
|
Loading…
Reference in New Issue
Block a user