Skip to content

Commit

Permalink
Set exceptions to development if App is debugging and default config …
Browse files Browse the repository at this point in the history
…is not set
  • Loading branch information
natanfelles committed Jan 29, 2022
1 parent e53face commit 99bdd52
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,15 @@ protected function prepareToRun(array $options = []) : ?Router
if ($options['autoloader'] !== false) {
static::autoloader($options['autoloader']);
}
$options['exceptions'] ??= 'default';
if ( ! isset($options['exceptions'])) {
$options['exceptions'] = 'default';
$configs = static::config()->getInstances('exceptions');
if ( ! isset($configs['default']) && isset(static::$debugCollector)) {
static::config()->set('exceptions', [
'environment' => ExceptionHandler::DEVELOPMENT,
]);
}
}
if ($options['exceptions'] !== false) {
static::exceptions($options['exceptions']);
}
Expand Down

0 comments on commit 99bdd52

Please sign in to comment.