Преглед изворни кода

Merge pull request #54 from allmarkedup/patch-1

Prevent exceptions from being thrown in file handler destructors
Jordi Boggiano пре 14 година
родитељ
комит
3d4e60d0cb
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      src/Monolog/Handler/AbstractHandler.php

+ 5 - 1
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
+        }
     }
 
     /**