Skip to content

Commit

Permalink
update & add error directly
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrayIterator committed Jul 15, 2024
1 parent 47db008 commit 0feea39
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion 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 @@ -877,7 +886,7 @@ final public function init() : static

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

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

Expand Down Expand Up @@ -929,6 +938,7 @@ public function getRegisteredDirectories(): array
return $this->registeredDirectories;
}

/** @noinspection PhpUnused */
public function getAppNameSpace(): ?string
{
return $this->appNameSpace;
Expand Down

0 comments on commit 0feea39

Please sign in to comment.