Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
Revert "Fixed catching bug"
Browse files Browse the repository at this point in the history
This reverts commit a3dddd9.
  • Loading branch information
CommandString committed Apr 1, 2023
1 parent a3dddd9 commit bb527b6
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,9 @@ public static function run(EmitterInterface $emitter = null): void

$response = self::invokeRoute($resolved, $request);
} catch (Throwable $e) {
foreach (self::$catchers as $class => $catcher) {
if ($catcher === $e::class || is_subclass_of($e::class, $class)) {
$resolved = self::resolveRoute($catcher);
}
}

if ($resolved === null) {
if (array_key_exists($e::class, self::$catchers)) {
$resolved = self::resolveRoute(self::$catchers[$e::class]);
} else {
$resolved = self::resolveRoute(self::$catchers[HttpInternalServerError::class] ?? []);
}

Expand Down

0 comments on commit bb527b6

Please sign in to comment.