提交 f1e5e584 编写于 作者: S stavrolia

Some rest of PR about improvement of exception message

上级 ad2af03f
......@@ -361,8 +361,7 @@ StoragePtr DatabaseLazy::loadTable(const Context & context, const String & table
}
catch (const Exception & e)
{
throw Exception("Cannot create table from metadata file " + table_metadata_path + ", error: " + e.displayText() +
", stack trace:\n" + e.getStackTrace().toString(),
throw Exception("Cannot create table from metadata file " + table_metadata_path + ", error: " + e.displayText() + DB::getCurrentExceptionMessage(true),
ErrorCodes::CANNOT_CREATE_TABLE_FROM_METADATA);
}
}
......
......@@ -81,8 +81,7 @@ try
catch (const Exception & e)
{
throw Exception(
"Cannot create object '" + query.table + "' from query " + serializeAST(query) + ", error: " + e.displayText() + ", stack trace:\n"
+ e.getStackTrace().toString(),
"Cannot create object '" + query.table + "' from query " + serializeAST(query) + ", error: " + e.displayText() + DB::getCurrentExceptionMessage(true),
ErrorCodes::CANNOT_CREATE_TABLE_FROM_METADATA);
}
......@@ -138,8 +137,7 @@ void DatabaseOrdinary::loadStoredObjects(
catch (const Exception & e)
{
throw Exception(
"Cannot parse definition from metadata file " + full_path + ", error: " + e.displayText() + ", stack trace:\n"
+ e.getStackTrace().toString(), ErrorCodes::CANNOT_PARSE_TEXT);
"Cannot parse definition from metadata file " + full_path + ", error: " + e.displayText() + DB::getCurrentExceptionMessage(true), ErrorCodes::CANNOT_PARSE_TEXT);
}
});
......
......@@ -214,7 +214,7 @@ bool ReplicatedMergeTreeRestartingThread::tryStartup()
}
catch (const Coordination::Exception & e)
{
LOG_ERROR(log, "Couldn't start replication: " << e.what() << ", " << e.displayText() << ", stack trace:\n" << e.getStackTrace().toString());
LOG_ERROR(log, "Couldn't start replication: " << e.what() << ", " << e.displayText() << DB::getCurrentExceptionMessage(true));
return false;
}
catch (const Exception & e)
......@@ -222,7 +222,7 @@ bool ReplicatedMergeTreeRestartingThread::tryStartup()
if (e.code() != ErrorCodes::REPLICA_IS_ALREADY_ACTIVE)
throw;
LOG_ERROR(log, "Couldn't start replication: " << e.what() << ", " << e.displayText() << ", stack trace:\n" << e.getStackTrace().toString());
LOG_ERROR(log, "Couldn't start replication: " << e.what() << ", " << e.displayText() << DB::getCurrentExceptionMessage(true));
return false;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册