Skip to content

Commit d16847f

Browse files
committed
ApplicationExtension: $catchExceptions can be '4xx' in addition to bool
1 parent 3f48f8e commit d16847f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Bridges/ApplicationDI/ApplicationExtension.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function getConfigSchema(): Nette\Schema\Schema
4747
])->castTo('array'),
4848
Expect::string()->dynamic(),
4949
)->firstIsDefault(),
50-
'catchExceptions' => Expect::bool(false)->dynamic(),
50+
'catchExceptions' => Expect::anyOf('4xx', true, false)->firstIsDefault()->dynamic(),
5151
'mapping' => Expect::anyOf(
5252
Expect::string(),
5353
Expect::arrayOf('string|array'),
@@ -77,6 +77,8 @@ public function loadConfiguration(): void
7777
->setFactory(Nette\Application\Application::class);
7878
if ($config->catchExceptions || !$this->debugMode) {
7979
$application->addSetup('$error4xxPresenter', [is_array($config->errorPresenter) ? $config->errorPresenter['4xx'] : $config->errorPresenter]);
80+
}
81+
if ($config->catchExceptions === true || !$this->debugMode) {
8082
$application->addSetup('$errorPresenter', [is_array($config->errorPresenter) ? $config->errorPresenter['5xx'] : $config->errorPresenter]);
8183
}
8284

0 commit comments

Comments
 (0)