Skip to content

Commit

Permalink
The load function must return a specific NotFoundResourceException in…
Browse files Browse the repository at this point in the history
…stead of Exception
  • Loading branch information
Pierre RAMBAUD committed Sep 17, 2019
1 parent 6195e42 commit a71dda7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ use Symfony\Component\Debug\Debug;

set_time_limit(0);

require __DIR__.'/../vendor/autoload.php';
require_once __DIR__.'/../autoload.php';
require_once __DIR__ . '/../config/config.inc.php';

$input = new ArgvInput();
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
namespace PrestaShopBundle\Translation\Loader;

use Db;
use Exception;
use PrestaShop\PrestaShop\Core\Addon\Theme\Theme;
use Symfony\Component\Translation\Loader\LoaderInterface;
use Symfony\Component\Translation\MessageCatalogue;
use Symfony\Component\Translation\MessageCatalogueInterface;
use Symfony\Component\Translation\Exception\NotFoundResourceException;

class SqlTranslationLoader implements LoaderInterface
{
Expand Down Expand Up @@ -71,7 +71,7 @@ public function load($resource, $locale, $domain = 'messages')
}

if (empty($localeResults[$locale])) {
throw new Exception(sprintf('Language not found in database: %s', $locale));
throw new NotFoundResourceException(sprintf('Language not found in database: %s', $locale));
}

$selectTranslationsQuery = '
Expand Down

0 comments on commit a71dda7

Please sign in to comment.