Skip to content

Commit

Permalink
Make sure we always call restore_error_handler() (#2915)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm committed Jul 17, 2021
1 parent 1d46cec commit 3f7640e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Handler/StreamHandler.php
Expand Up @@ -237,8 +237,11 @@ private function createResource(callable $callback)
return true;
});

$resource = $callback();
\restore_error_handler();
try {
$resource = $callback();
} finally {
\restore_error_handler();
}

if (!$resource) {
$message = 'Error creating resource: ';
Expand Down

0 comments on commit 3f7640e

Please sign in to comment.