Always use errorstream for DEBUG_EXCEPTION_HANDLER
authorShadowNinja <shadowninja@minetest.net>
Wed, 14 Oct 2015 06:33:04 +0000 (02:33 -0400)
committerkwolekr <kwolekr@minetest.net>
Wed, 14 Oct 2015 06:33:30 +0000 (02:33 -0400)
src/debug.h
src/emerge.cpp
src/httpfetch.cpp
src/main.cpp
src/network/connection.cpp
src/server.cpp
src/util/thread.h

index 94b268eddaa821593e4840526e6a5d3fee9cfcd7..e8d35ba709469ebaa53309af54c3de8ca5b4a5a3 100644 (file)
@@ -126,16 +126,16 @@ private:
 
 #if CATCH_UNHANDLED_EXCEPTIONS == 1
        #define BEGIN_DEBUG_EXCEPTION_HANDLER try {
-       #define END_DEBUG_EXCEPTION_HANDLER(logstream)           \
-               } catch (std::exception &e) {                        \
-                       logstream << "An unhandled exception occurred: " \
-                               << e.what() << std::endl;                    \
-                       FATAL_ERROR(e.what());                           \
+       #define END_DEBUG_EXCEPTION_HANDLER                        \
+               } catch (std::exception &e) {                          \
+                       errorstream << "An unhandled exception occurred: " \
+                               << e.what() << std::endl;                      \
+                       FATAL_ERROR(e.what());                             \
                }
 #else
        // Dummy ones
        #define BEGIN_DEBUG_EXCEPTION_HANDLER
-       #define END_DEBUG_EXCEPTION_HANDLER(logstream)
+       #define END_DEBUG_EXCEPTION_HANDLER
 #endif
 
 #endif // DEBUG_HEADER
index 3532ca29dea40f79feecf14049c127a43c68086c..1e40b915a18890b8cf694b0209f9693724f83e93 100644 (file)
@@ -700,6 +700,6 @@ void *EmergeThread::run()
                m_server->setAsyncFatalError(err.str());
        }
 
-       END_DEBUG_EXCEPTION_HANDLER(errorstream)
+       END_DEBUG_EXCEPTION_HANDLER
        return NULL;
 }
index 6040b1b3b302778774b09ea4bb8d29fae0895a23..979f11160e893cb382630a63e650ff4596a94f7a 100644 (file)
@@ -677,7 +677,7 @@ protected:
                        else
                                waitForIO(100);
 
-                       END_DEBUG_EXCEPTION_HANDLER(errorstream)
+                       END_DEBUG_EXCEPTION_HANDLER
                }
 
                // Call curl_multi_remove_handle and cleanup easy handles
index cc8b4bcaa97bd5300414d1d8223e134d445d5ccf..53f8a1fb77f95b33b318db44ccc2cbf377204447 100644 (file)
@@ -226,7 +226,7 @@ int main(int argc, char *argv[])
        // Stop httpfetch thread (if started)
        httpfetch_cleanup();
 
-       END_DEBUG_EXCEPTION_HANDLER(errorstream);
+       END_DEBUG_EXCEPTION_HANDLER
 
        return retval;
 }
index 0738c6a1f3703f30e2e67759d3eeb147aa62432b..f7452d8e48ef18f5c81645329584336f00f4ce04 100644 (file)
@@ -1316,7 +1316,7 @@ void * ConnectionSendThread::run()
                /* send non reliable packets */
                sendPackets(dtime);
 
-               END_DEBUG_EXCEPTION_HANDLER(errorstream);
+               END_DEBUG_EXCEPTION_HANDLER
        }
 
        PROFILE(g_profiler->remove(ThreadIdentifier.str()));
@@ -2097,7 +2097,7 @@ void * ConnectionReceiveThread::run()
                        }
                }
 #endif
-               END_DEBUG_EXCEPTION_HANDLER(errorstream);
+               END_DEBUG_EXCEPTION_HANDLER
        }
 
        PROFILE(g_profiler->remove(ThreadIdentifier.str()));
index 8f105ffd2757071b30bb0797ed831e211c927f07..d6207538ffc1e1ffb66eae888aa285ab8a33d15d 100644 (file)
@@ -112,7 +112,7 @@ void *ServerThread::run()
                }
        }
 
-       END_DEBUG_EXCEPTION_HANDLER(errorstream)
+       END_DEBUG_EXCEPTION_HANDLER
 
        return NULL;
 }
index a32871aab87dfcb1f956c6d4ec86e8a0382c2b3e..8d8b6fe7f80fbad8e93044b3a36fb5c7c39aef2d 100644 (file)
@@ -223,7 +223,7 @@ public:
                        doUpdate();
                }
 
-               END_DEBUG_EXCEPTION_HANDLER(errorstream)
+               END_DEBUG_EXCEPTION_HANDLER
 
                return NULL;
        }