Bug 1506410 - Fix up two other instances of ParseError not passing in metadata r=jgraham
authorWes Kocher <wkocher@mozilla.com>
Mon, 12 Nov 2018 10:11:48 +0000
changeset 445885 702485851935a8b3efb62b5efd3b82543b5167a4
parent 445884 a55ab1b0e47865c7a63ac60b0a54a1a9c871813c
child 445886 74dbfbf5624545e007b3c0ed9c456e1e9d91ebdb
push id109795
push userrmaries@mozilla.com
push dateMon, 12 Nov 2018 17:23:23 +0000
treeherdermozilla-inbound@ccc0ff898ca2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1506410
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1506410 - Fix up two other instances of ParseError not passing in metadata r=jgraham Depends on D11575 Differential Revision: https://phabricator.services.mozilla.com/D11576
testing/web-platform/tests/tools/wptrunner/wptrunner/wptmanifest/parser.py
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wptmanifest/parser.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wptmanifest/parser.py
@@ -550,17 +550,18 @@ class Parser(object):
             self.consume()
             self.expect(token_types.separator)
             self.value_block()
             self.tree.pop()
 
         while self.token == (token_types.paren, "["):
             self.consume()
             if self.token[0] != token_types.string:
-                raise ParseError
+                raise ParseError(self.tokenizer.filename, self.tokenizer.line_number,
+                                 "Token '{}' is not a string".format(self.token[0]))
             self.tree.append(DataNode(self.token[1]))
             self.consume()
             self.expect(token_types.paren, "]")
             if self.token[0] == token_types.group_start:
                 self.consume()
                 self.data_block()
                 self.eof_or_end_group()
             self.tree.pop()
@@ -579,17 +580,18 @@ class Parser(object):
             self.consume()
             self.expression_values()
             if self.token[0] == token_types.string:
                 self.value()
             self.eof_or_end_group()
         elif self.token[0] == token_types.atom:
             self.atom()
         else:
-            raise ParseError
+            raise ParseError(self.tokenizer.filename, self.tokenizer.line_number,
+                             "Token '{}' is not a known type".format(self.token[0]))
 
     def list_value(self):
         self.tree.append(ListNode())
         while self.token[0] in (token_types.atom, token_types.string):
             if self.token[0] == token_types.atom:
                 self.atom()
             else:
                 self.value()