Skip to content

Commit d7fc3b4

Browse files
committed
Stop throwing exceptions if we can't format
1 parent 4b17ed5 commit d7fc3b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/Parser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ public function format($code)
358358
try {
359359
$parsed = $parser->parse($code);
360360
} catch (Exception $e) {
361-
throw new Exception("could not parse code");
361+
// can't format, but we can still return...
362+
return $code;
362363
}
363364

364365
return $this->printer->prettyPrintFile($parsed);

0 commit comments

Comments
 (0)