Skip to content

Commit

Permalink
Stop throwing exceptions if we can't format
Browse files Browse the repository at this point in the history
  • Loading branch information
assertchris committed Sep 18, 2018
1 parent 4b17ed5 commit d7fc3b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ public function format($code)
try {
$parsed = $parser->parse($code);
} catch (Exception $e) {
throw new Exception("could not parse code");
// can't format, but we can still return...
return $code;
}

return $this->printer->prettyPrintFile($parsed);
Expand Down

0 comments on commit d7fc3b4

Please sign in to comment.