GUI stuff\r
*/\r
\r
+ /*\r
+ If an error occurs, this is set to something and the\r
+ menu-game loop is restarted. It is then displayed before\r
+ the menu.\r
+ */\r
+ std::wstring error_message = L"";\r
+\r
/*\r
Menu-game loop\r
*/\r
while(device->run() && kill == false)\r
{\r
- /*\r
- If an error occurs, this is set to something and the\r
- menu-game loop is restarted. It is then displayed before\r
- the menu.\r
- */\r
- std::wstring error_message = L"";\r
-\r
// This is used for catching disconnects\r
try\r
{\r
dstream<<DTIME<<"Connection error (timed out?)"<<std::endl;\r
error_message = L"Connection error (timed out?)";\r
}\r
+ catch(SocketException &e)\r
+ {\r
+ dstream<<DTIME<<"Socket error (port already in use?)"<<std::endl;\r
+ error_message = L"Socket error (port already in use?)";\r
+ }\r
+#ifdef NDEBUG\r
+ catch(std::exception &e)\r
+ {\r
+ narrow_message = "Some exception, what()=\"";\r
+ narrow_message += e.what();\r
+ narrow_message += "\"";\r
+ dstream<<DTIME<<narrow_message<<std::endl;\r
+ error_message = narrow_to_wide(narrow_message);\r
+ }\r
+#endif\r
\r
} // Menu-game loop\r
\r