Daemon: added stack trace in case of DB::Exception [#CONV-2807].

This commit is contained in:
Alexey Milovidov 2011-12-20 19:30:06 +00:00
parent 3bffaff936
commit 11e5fb35ec

View File

@ -27,6 +27,8 @@
#include <Poco/ErrorHandler.h>
#include <Poco/NumberFormatter.h>
#include <DB/Core/Exception.h>
#include "revision.h"
@ -274,6 +276,11 @@ void Daemon::handleNotification(TaskFailedNotification *_tfn)
Logger *lg = &(logger());
LOG_ERROR(lg, "Task '" << fn->task()->name() << "' failed. Daemon is shutting down. Reason - " << fn->reason().displayText());
if (const DB::Exception * e = dynamic_cast<const DB::Exception *>(&fn->reason()))
{
LOG_ERROR(lg, "Stack trace:\n" << e->getStackTrace().toString());
}
ServerApplication::terminate();
}