Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqlTranslator must throw a NotFoundResourceException #15515

Merged
merged 1 commit into from
Sep 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
PierreRambaud marked this conversation as resolved.
Show resolved Hide resolved

$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