Skip to content

Commit

Permalink
Merge branch '5.4' into 6.0
Browse files Browse the repository at this point in the history
* 5.4:
  [DependencyInjection] Add `SubscribedService` attribute, deprecate current `ServiceSubscriberTrait` usage
  Use try/finally to restore error handlers
  Allow serializer default context configuration
  • Loading branch information
nicolas-grekas committed Oct 27, 2021
2 parents 5e46443 + e5e81a6 commit 3e9a18c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,15 +705,10 @@ private static function box(callable $func, mixed ...$args): mixed
self::$lastError = null;
set_error_handler(__CLASS__.'::handleError');
try {
$result = $func(...$args);
return $func(...$args);
} finally {
restore_error_handler();

return $result;
} catch (\Throwable $e) {
}
restore_error_handler();

throw $e;
}

/**
Expand Down

0 comments on commit 3e9a18c

Please sign in to comment.