From 8350b6bd36d3a4bb3a99dfbf67e746f4f815927c Mon Sep 17 00:00:00 2001 From: Fbenas Date: Mon, 7 May 2018 15:02:39 +0100 Subject: Add some simple exception handling for bad inputs --- src/Script/Output.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Script/Output.php') diff --git a/src/Script/Output.php b/src/Script/Output.php index 8f7a689..e61cff8 100644 --- a/src/Script/Output.php +++ b/src/Script/Output.php @@ -3,6 +3,7 @@ namespace App\Script; use App\Model\Collection; +use Exception; class Output { @@ -20,4 +21,9 @@ class Output echo implode("\n\n", $out) . "\n"; } + + public function printException(Exception $e) + { + echo "An unexpected exception occured:\n" . $e->getMessage() . "\n"; + } } -- cgit v1.2.3