diff --git a/third-party/thrift/src/thrift/compiler/whisker/parser.cc b/third-party/thrift/src/thrift/compiler/whisker/parser.cc index 7e61048c599179..b5de879846bc47 100644 --- a/third-party/thrift/src/thrift/compiler/whisker/parser.cc +++ b/third-party/thrift/src/thrift/compiler/whisker/parser.cc @@ -1615,8 +1615,10 @@ class parser { if (try_consume_token(&scan, tok::pipe)) { const token* first_argument = try_consume_token(&scan, tok::identifier); if (first_argument == nullptr) { - report_fatal_expected( - scan, "at least one argument in partial-block '{}'", id.name); + report_fatal_error( + scan, + "expected at least one argument in partial-block '{}' but found none", + id.name); } arguments.insert(make_identifier(*first_argument)); while (const token* argument = @@ -1656,8 +1658,10 @@ class parser { const token* first_capture = try_consume_token(&scan, tok::identifier); if (first_capture == nullptr) { - report_fatal_expected( - scan, "at least one capture in partial-block '{}'", id.name); + report_fatal_error( + scan, + "expected at least one capture in partial-block '{}' but found none", + id.name); } insert_capture(make_identifier(*first_capture)); while (const token* capture = try_consume_token(&scan, tok::identifier)) { diff --git a/third-party/thrift/src/thrift/compiler/whisker/test/parser_test.cc b/third-party/thrift/src/thrift/compiler/whisker/test/parser_test.cc index 97f322466048c6..fac41117a324ca 100644 --- a/third-party/thrift/src/thrift/compiler/whisker/test/parser_test.cc +++ b/third-party/thrift/src/thrift/compiler/whisker/test/parser_test.cc @@ -1085,7 +1085,7 @@ TEST_F(ParserTest, partial_block_empty_arguments) { diagnostics, testing::ElementsAre(diagnostic( diagnostic_level::error, - "expected at least one argument in partial-block 'foo' but found `|`", + "expected at least one argument in partial-block 'foo' but found none", path_to_file(1), 1))); } @@ -1110,7 +1110,7 @@ TEST_F(ParserTest, partial_block_empty_captures) { diagnostics, testing::ElementsAre(diagnostic( diagnostic_level::error, - "expected at least one capture in partial-block 'foo' but found `|`", + "expected at least one capture in partial-block 'foo' but found none", path_to_file(1), 1))); }