Skip to content

Commit

Permalink
Fix error message and reduce scope of try block
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaranmcnulty committed Feb 10, 2021
1 parent 9373a13 commit 363dd69
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Behat/Gherkin/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,11 +566,13 @@ protected function parseExamples()
*/
protected function parseTable()
{
$table = $this->parseTableRows();

try {
return new TableNode($this->parseTableRows());
return new TableNode($table);
} catch(NodeException $e) {
throw new ParserException(
$e->getMessage() . $this->file ? ' in file '.$this->file : '',
$e->getMessage() . ($this->file ? ' in file '.$this->file : ''),
0,
$e
);
Expand Down

0 comments on commit 363dd69

Please sign in to comment.