diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-04-23 18:53:39 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-04-23 18:53:39 +0300 |
commit | ea69a49a7ba040a2e197ae2bbe5ac31f6738a3ba (patch) | |
tree | 157fa41019eb7a00762cfb6d4c6d99355f47e774 /src | |
parent | 179fc8597bfddc232d1306bf3280bf5bc05e07c7 (diff) | |
download | minetest-ea69a49a7ba040a2e197ae2bbe5ac31f6738a3ba.tar.gz minetest-ea69a49a7ba040a2e197ae2bbe5ac31f6738a3ba.tar.bz2 minetest-ea69a49a7ba040a2e197ae2bbe5ac31f6738a3ba.zip |
tuned error reporting a bit
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp index dd8d5d7d4..5349310d6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1249,17 +1249,17 @@ int main(int argc, char *argv[]) */
/*
+ If an error occurs, this is set to something and the
+ menu-game loop is restarted. It is then displayed before
+ the menu.
+ */
+ std::wstring error_message = L"";
+
+ /*
Menu-game loop
*/
while(device->run() && kill == false)
{
- /*
- If an error occurs, this is set to something and the
- menu-game loop is restarted. It is then displayed before
- the menu.
- */
- std::wstring error_message = L"";
-
// This is used for catching disconnects
try
{
@@ -1404,6 +1404,21 @@ int main(int argc, char *argv[]) dstream<<DTIME<<"Connection error (timed out?)"<<std::endl;
error_message = L"Connection error (timed out?)";
}
+ catch(SocketException &e)
+ {
+ dstream<<DTIME<<"Socket error (port already in use?)"<<std::endl;
+ error_message = L"Socket error (port already in use?)";
+ }
+#ifdef NDEBUG
+ catch(std::exception &e)
+ {
+ narrow_message = "Some exception, what()=\"";
+ narrow_message += e.what();
+ narrow_message += "\"";
+ dstream<<DTIME<<narrow_message<<std::endl;
+ error_message = narrow_to_wide(narrow_message);
+ }
+#endif
} // Menu-game loop
|