class MyServer implements MessageComponentInterface
{
....
public function onError(ConnectionInterface $conn, \Exception $e)
{
DI::get()->getLogger()->error(
"An error has occurred: {$e->getMessage()}:\n{$e->getTraceAsString()}",
[__FUNCTION__]
);
$conn->close();
}
}
set_error_handler(
function ($code, $string, $errfile, $errline) {
throw new ErrorException($string, $code);
},
E_ALL | E_STRICT
);