From 5055102e88d4ffd3b00990a776bb7d684cbafb07 Mon Sep 17 00:00:00 2001 From: Mark Perkins Date: Sat, 11 Feb 2012 11:07:55 +0000 Subject: [PATCH 1/2] Add try/catch block around call to close method in the AbstractHandler destructor. --- src/Monolog/Handler/AbstractHandler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Monolog/Handler/AbstractHandler.php b/src/Monolog/Handler/AbstractHandler.php index 6dbf77a7..c806d560 100644 --- a/src/Monolog/Handler/AbstractHandler.php +++ b/src/Monolog/Handler/AbstractHandler.php @@ -154,7 +154,11 @@ abstract class AbstractHandler implements HandlerInterface public function __destruct() { - $this->close(); + try { + $this->close(); + } catch( \Exception $e ) { + // do nothing + } } /** From 12f27c2b2432c2d83fa6b2e7c1325a6dba12aa93 Mon Sep 17 00:00:00 2001 From: Mark Perkins Date: Sat, 11 Feb 2012 11:28:05 +0000 Subject: [PATCH 2/2] Remove extra spaces between braces. --- src/Monolog/Handler/AbstractHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Monolog/Handler/AbstractHandler.php b/src/Monolog/Handler/AbstractHandler.php index c806d560..1349c25d 100644 --- a/src/Monolog/Handler/AbstractHandler.php +++ b/src/Monolog/Handler/AbstractHandler.php @@ -156,7 +156,7 @@ abstract class AbstractHandler implements HandlerInterface { try { $this->close(); - } catch( \Exception $e ) { + } catch(\Exception $e) { // do nothing } }