File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
library/Notifications/Daemon Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 44
55namespace Icinga \Module \Notifications \Daemon ;
66
7- use Exception ;
87use Fig \Http \Message \StatusCodeInterface ;
98use Icinga \Application \Config ;
109use Icinga \Application \Logger ;
2019use React \Http \Message \Response ;
2120use React \Socket \ConnectionInterface ;
2221use React \Socket \SocketServer ;
22+ use Throwable ;
2323
2424class Server
2525{
@@ -106,12 +106,15 @@ public function load(): void
106106 $ this ->http = new HttpServer (function (ServerRequestInterface $ request ) {
107107 return $ this ->handleRequest ($ request );
108108 });
109+ $ this ->http ->on ('error ' , function (Throwable $ error ) {
110+ self ::$ logger ::error (self ::PREFIX . "received an error on the http server: %s " , $ error );
111+ });
109112 // subscribe to socket events
110113 $ this ->socket ->on ('connection ' , function (ConnectionInterface $ connection ) {
111114 $ this ->onSocketConnection ($ connection );
112115 });
113- $ this ->socket ->on ('error ' , function (Exception $ error ) {
114- self ::$ logger ::error (self ::PREFIX . "received an error on the socket: " . $ error-> getMessage () );
116+ $ this ->socket ->on ('error ' , function (Throwable $ error ) {
117+ self ::$ logger ::error (self ::PREFIX . "received an error on the socket: %s " , $ error );
115118 });
116119 // attach http server to socket
117120 $ this ->http ->listen ($ this ->socket );
You can’t perform that action at this time.
0 commit comments