Skip to content

Commit

Permalink
fix error handling for parsing errors; fixes bblfsh#17
Browse files Browse the repository at this point in the history
Signed-off-by: Denys Smirnov <denys@sourced.tech>
  • Loading branch information
Denys Smirnov committed Nov 8, 2018
1 parent 6739710 commit 07532c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion native/src/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function parse(data) {
return ok(ast);
} catch (ex) {
if (ex instanceof GuessParsingError) {
return error(ex.allMessages);
return error(...ex.allMessages);
}
return error([ex.message]);
}
Expand Down
2 changes: 1 addition & 1 deletion native/src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class GuessParsingError extends Error {
constructor(...messages) {
super(messages.join(', '));

this.allMessages = message;
this.allMessages = messages;
}
}

Expand Down

0 comments on commit 07532c0

Please sign in to comment.