From d7fc3b45c14d3e76a97f46cc4599f2a2cf8734f6 Mon Sep 17 00:00:00 2001 From: Christopher Pitt Date: Tue, 18 Sep 2018 20:08:08 +0200 Subject: [PATCH] Stop throwing exceptions if we can't format --- source/Parser.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/Parser.php b/source/Parser.php index 33e4814..025e302 100644 --- a/source/Parser.php +++ b/source/Parser.php @@ -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);