Add Error Handler for Sockets