Skip to content

Commit 884acbc

Browse files
committed
Clarify the depth limit exception message
1 parent b4e8bcc commit 884acbc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/SyntaxTree.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,8 +700,8 @@ struct ast_action<selection_set> : maybe_nothing
700700
{
701701
std::ostringstream oss;
702702

703-
oss << "Exceeded " << in.depthLimit()
704-
<< " nested depth limit for https://spec.graphql.org/October2021/#SelectionSet";
703+
oss << "Exceeded nested depth limit: " << in.depthLimit()
704+
<< " for https://spec.graphql.org/October2021/#SelectionSet";
705705

706706
throw parse_error(oss.str(), in);
707707
}

test/PegtlExecutableTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ TEST(PegtlExecutableCase, ParserDepthLimitExceeded)
220220

221221
const std::string_view error { ex.what() };
222222
constexpr auto expected =
223-
"GraphQL:4:3: Exceeded 2 nested depth limit for https://spec.graphql.org/October2021/#SelectionSet"sv;
223+
"GraphQL:4:3: Exceeded nested depth limit: 2 for https://spec.graphql.org/October2021/#SelectionSet"sv;
224224

225225
EXPECT_TRUE(error == expected) << ex.what();
226226

0 commit comments

Comments
 (0)