Skip to content

Commit

Permalink
Always use errorstream for DEBUG_EXCEPTION_HANDLER
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowNinja authored and kwolekr committed Oct 14, 2015
1 parent 4236792 commit 6f4d6cb
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/debug.h
Expand Up @@ -126,16 +126,16 @@ class DebugStacker

#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
Expand Down
2 changes: 1 addition & 1 deletion src/emerge.cpp
Expand Up @@ -700,6 +700,6 @@ void *EmergeThread::run()
m_server->setAsyncFatalError(err.str());
}

END_DEBUG_EXCEPTION_HANDLER(errorstream)
END_DEBUG_EXCEPTION_HANDLER
return NULL;
}
2 changes: 1 addition & 1 deletion src/httpfetch.cpp
Expand Up @@ -677,7 +677,7 @@ class CurlFetchThread : public Thread
else
waitForIO(100);

END_DEBUG_EXCEPTION_HANDLER(errorstream)
END_DEBUG_EXCEPTION_HANDLER
}

// Call curl_multi_remove_handle and cleanup easy handles
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/network/connection.cpp
Expand Up @@ -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()));
Expand Down Expand Up @@ -2097,7 +2097,7 @@ void * ConnectionReceiveThread::run()
}
}
#endif
END_DEBUG_EXCEPTION_HANDLER(errorstream);
END_DEBUG_EXCEPTION_HANDLER
}

PROFILE(g_profiler->remove(ThreadIdentifier.str()));
Expand Down
2 changes: 1 addition & 1 deletion src/server.cpp
Expand Up @@ -112,7 +112,7 @@ void *ServerThread::run()
}
}

END_DEBUG_EXCEPTION_HANDLER(errorstream)
END_DEBUG_EXCEPTION_HANDLER

return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/thread.h
Expand Up @@ -223,7 +223,7 @@ class UpdateThread : public Thread
doUpdate();
}

END_DEBUG_EXCEPTION_HANDLER(errorstream)
END_DEBUG_EXCEPTION_HANDLER

return NULL;
}
Expand Down

0 comments on commit 6f4d6cb

Please sign in to comment.