diff options
author | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2020-04-01 08:49:33 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2020-04-01 08:49:33 +0000 |
commit | 4153969ca13541e7434963d02add12d574c9a461 (patch) | |
tree | 9d8beefd581abd876004ac81e2747a1ce9c247f9 /document | |
parent | 201a7320f48b1d8868bc1fb38ee1182ad3d84dd7 (diff) |
Also include actual expression size in message
Diffstat (limited to 'document')
-rw-r--r-- | document/src/tests/documentselectparsertest.cpp | 3 | ||||
-rw-r--r-- | document/src/vespa/document/select/parser.cpp | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/document/src/tests/documentselectparsertest.cpp b/document/src/tests/documentselectparsertest.cpp index 2d2b7bfd085..59f4ce69b33 100644 --- a/document/src/tests/documentselectparsertest.cpp +++ b/document/src/tests/documentselectparsertest.cpp @@ -1650,7 +1650,8 @@ TEST_F(DocumentSelectParserTest, selection_has_upper_limit_on_input_size) { std::string expr = ("testdoctype1.a_biii" + std::string(select::ParserLimits::MaxSelectionByteSize, 'i') + "iiig_identifier"); - verifyFailedParse(expr, "ParsingFailedException: expression is too large to be parsed (max 1048576 bytes)"); + verifyFailedParse(expr, "ParsingFailedException: expression is too large to be " + "parsed (max 1048576 bytes, got 1048610)"); } TEST_F(DocumentSelectParserTest, lexing_does_not_have_superlinear_time_complexity) { diff --git a/document/src/vespa/document/select/parser.cpp b/document/src/vespa/document/select/parser.cpp index f7c2bebb007..fadb46e5aa3 100644 --- a/document/src/vespa/document/select/parser.cpp +++ b/document/src/vespa/document/select/parser.cpp @@ -14,8 +14,8 @@ namespace { void verify_expression_not_too_large(const std::string& expr) { if (expr.size() > ParserLimits::MaxSelectionByteSize) { throw ParsingFailedException(vespalib::make_string( - "expression is too large to be parsed (max %zu bytes)", - ParserLimits::MaxSelectionByteSize)); + "expression is too large to be parsed (max %zu bytes, got %zu)", + ParserLimits::MaxSelectionByteSize, expr.size())); } } |