logic: improve logging if exception occurred while loading project (#1004)
This commit is contained in:
+19
-11
@@ -32,6 +32,8 @@
|
||||
#include "utilityString.h"
|
||||
#include "utilityUuid.h"
|
||||
|
||||
#include "CppSQLite3.h"
|
||||
|
||||
std::shared_ptr<Application> Application::s_instance;
|
||||
std::string Application::s_uuid;
|
||||
|
||||
@@ -306,20 +308,26 @@ void Application::handleMessage(MessageLoadProject* message)
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
LOG_ERROR_STREAM(<< "Failed to load project, exception thrown: " << e.what());
|
||||
MessageStatus(
|
||||
L"Failed to load project, exception was thrown: " + projectSettingsFilePath.wstr(),
|
||||
true)
|
||||
.dispatch();
|
||||
const std::wstring message = L"Failed to load project at \"" +
|
||||
projectSettingsFilePath.wstr() + L"\" with exception: " +
|
||||
utility::decodeFromUtf8(e.what());
|
||||
LOG_ERROR(message);
|
||||
MessageStatus(message, true).dispatch();
|
||||
}
|
||||
catch (CppSQLite3Exception& e)
|
||||
{
|
||||
const std::wstring message = L"Failed to load project at \"" +
|
||||
projectSettingsFilePath.wstr() + L"\" with sqlite exception: " +
|
||||
utility::decodeFromUtf8(e.errorMessage());
|
||||
LOG_ERROR(message);
|
||||
MessageStatus(message, true).dispatch();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
LOG_ERROR_STREAM(<< "Failed to load project, unknown exception thrown.");
|
||||
MessageStatus(
|
||||
L"Failed to load project, unknown exception was thrown: " +
|
||||
projectSettingsFilePath.wstr(),
|
||||
true)
|
||||
.dispatch();
|
||||
const std::wstring message = L"Failed to load project at \"" +
|
||||
projectSettingsFilePath.wstr() + L"\" with unknown exception.";
|
||||
LOG_ERROR(message);
|
||||
MessageStatus(message, true).dispatch();
|
||||
}
|
||||
|
||||
if (message->refreshMode != REFRESH_NONE)
|
||||
|
||||
Reference in New Issue
Block a user