use unittest include from util!
[senf.git] / Console / Server.cc
index 569a7cf..72fd25c 100644 (file)
@@ -126,10 +126,10 @@ prefix_ void senf::console::Client::clientData(ReadHelper<ClientHandle>::ptr hel
         return;
     }
 
-#   warning fix Client::clientData implementation
-    // Remove the 'dup' needed here so we don't close the same fd twice (see Client constructor)
-    // Make output non-blocking
-    // Don't register a new ReadHelper every round
+    ///\fixme Fix Client::clientData implementation
+    /// Remove the 'dup' needed here so we don't close the same fd twice (see Client constructor)
+    /// Make output non-blocking
+    /// Don't register a new ReadHelper every round
 
     std::string data (tail_ + helper->data());
     tail_ = helper->tail();
@@ -143,7 +143,13 @@ prefix_ void senf::console::Client::clientData(ReadHelper<ClientHandle>::ptr hel
         // THIS COMMITS SUICIDE. THE INSTANCE IS GONE AFTER stopClient RETURNS
         stopClient();
         return;
-    }        
+    }
+    catch (std::exception & ex) {
+        out_ << ex.what() << std::endl;
+    }
+    catch (...) {
+        out_ << "unidentified error (unknown exception thrown)" << std::endl;
+    }
 
     showPrompt();
     ReadHelper<ClientHandle>::dispatch( handle_, 16384u, ReadUntil("\n"),