From f33b7fb5bffb6c83856b17eb7effa2d0935a2c42 Mon Sep 17 00:00:00 2001 From: bruce aldridge Date: Mon, 8 Jun 2020 14:52:42 +1200 Subject: [PATCH] Stop unwanted outputbuffing notice > If the function fails it generates an E_NOTICE. prevent notice as this will break the error catching. --- src/TaskRunner.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/TaskRunner.php b/src/TaskRunner.php index 8ff9204..5aa6e2a 100644 --- a/src/TaskRunner.php +++ b/src/TaskRunner.php @@ -140,8 +140,12 @@ public function handleError(\Exception $exception) $tx->rollBack(); } - $output = ob_get_contents(); - ob_end_clean(); + $output = ''; + + if(ob_get_length() > 0) { + $output = ob_get_contents(); + ob_end_clean(); + } $this->error = true; $this->log($output);