Skip to content

Commit

Permalink
Update BaseKernel.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrayIterator authored Jul 15, 2024
1 parent f75c551 commit 6514cb3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/HttpKernel/BaseKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use ArrayAccess\TrayDigita\L10n\Translations\Adapter\Gettext\PoMoAdapter;
use ArrayAccess\TrayDigita\L10n\Translations\Adapter\Json\JsonAdapter;
use ArrayAccess\TrayDigita\L10n\Translations\Interfaces\TranslatorInterface;
use ArrayAccess\TrayDigita\Middleware\ErrorMiddleware;
use ArrayAccess\TrayDigita\Middleware\RoutingMiddleware;
use ArrayAccess\TrayDigita\PossibleRoot;
use ArrayAccess\TrayDigita\Util\Filter\Consolidation;
Expand Down Expand Up @@ -837,6 +838,14 @@ final public function init() : static
} catch (Throwable) {
$debugMiddleware = new DebuggingMiddleware($container);
}
try {
$errorMiddleware = ContainerHelper::resolveCallable(
ErrorMiddleware::class,
$container
);
} catch (Throwable) {
$errorMiddleware = new ErrorMiddleware($container);
}
// @dispatch(kernel.initConfig)
$manager->dispatch('kernel.initConfig', $this);
} finally {
Expand Down Expand Up @@ -876,8 +885,8 @@ final public function init() : static
KernelCommandLoader::register($this);

// registering debug middleware at the first middleware
$httpKernel->addMiddleware($debugMiddleware);

$httpKernel->addDeferredMiddleware($debugMiddleware);
$httpKernel->addDeferredMiddleware($errorMiddleware);
return $this;
}

Expand Down

0 comments on commit 6514cb3

Please sign in to comment.