Catching exception if client closes connection.