Skip to content

Commit

Permalink
Merge pull request #3309 from bolt/catch-exception-locales
Browse files Browse the repository at this point in the history
Catch more broad Exception in `Locales::getName`
  • Loading branch information
bobdenotter authored Aug 31, 2022
2 parents 82c4524 + 4dd14d3 commit 63fa81d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Utils/LocaleHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Bolt\Configuration\Config;
use Bolt\Repository\ContentRepository;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Intl\Exception\MissingResourceException;
use Symfony\Component\Intl\Locales;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Tightenco\Collect\Support\Collection;
Expand Down Expand Up @@ -186,7 +185,7 @@ public function localeInfo($localeCode): Collection
try {
$locale['name'] = Locales::getName($localeCode);
$locale['localizedname'] = Locales::getName($localeCode, $localeCode);
} catch (MissingResourceException $e) {
} catch (\ErrorException $e) {
$locale['name'] = 'unknown';
$locale['localizedname'] = 'unknown';
}
Expand Down

0 comments on commit 63fa81d

Please sign in to comment.