未验证 提交 385e8839 编写于 作者: A Alexander Kuzmenkov 提交者: GitHub

Quote expected strings in parse error messages

上级 9a2bf270
......@@ -74,12 +74,12 @@ UInt128 stringToUUID(const String & str)
void NO_INLINE throwAtAssertionFailed(const char * s, ReadBuffer & buf)
{
WriteBufferFromOwnString out;
out << "Cannot parse input: expected " << escape << s;
out << "Cannot parse input: expected " << quote << s;
if (buf.eof())
out << " at end of stream.";
else
out << " before: " << escape << String(buf.position(), std::min(SHOW_CHARS_ON_SYNTAX_ERROR, buf.buffer().end() - buf.position()));
out << " before: " << quote << String(buf.position(), std::min(SHOW_CHARS_ON_SYNTAX_ERROR, buf.buffer().end() - buf.position()));
throw Exception(out.str(), ErrorCodes::CANNOT_PARSE_INPUT_ASSERTION_FAILED);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册