Merge branch 'fix14' of https://github.com/proller/ClickHouse into proller-fix14

This commit is contained in:
Alexey Milovidov 2019-01-30 16:56:53 +03:00
commit 9b75767135
2 changed files with 10 additions and 3 deletions

View File

@ -22,6 +22,7 @@ namespace ErrorCodes
extern const int STD_EXCEPTION;
extern const int UNKNOWN_EXCEPTION;
extern const int CANNOT_TRUNCATE_FILE;
extern const int LOGICAL_ERROR;
}
@ -77,6 +78,10 @@ std::string getCurrentExceptionMessage(bool with_stacktrace, bool check_embedded
try
{
// Avoid terminate if called outside catch block. Should not happen.
if (!std::current_exception())
return "No exception.";
throw;
}
catch (const Exception & e)
@ -129,6 +134,10 @@ int getCurrentExceptionCode()
{
try
{
// Avoid terminate if called outside catch block. Should not happen.
if (!std::current_exception())
return ErrorCodes::LOGICAL_ERROR;
throw;
}
catch (const Exception & e)

View File

@ -222,9 +222,7 @@ void ExternalLoader::reloadAndUpdate(bool throw_on_error)
}
else
{
tryLogCurrentException(log, "Cannot update " + object_name + " '" + name + "', leaving old version");
if (throw_on_error)
throw;
tryLogException(exception, log, "Cannot update " + object_name + " '" + name + "', leaving old version");
}
}
}