Skip to content

Commit a36cd2d

Browse files
committed
Merge branch '6.2' into 6.3
* 6.2: [ExpressionLanguage] Fix BC of cached SerializedParsedExpression containing GetAttrNode [HttpKernel] Fix CacheAttributeListener priority [DependencyInjection] Fix bug when tag name is a text node [VarExporter] Fix adding a key to an uninitialized array Fix missing command not matching namespace error message [SecurityBundle] Fix authenticator existence check in `Security::login()` [TwigBundle] Alias BodyRendererInterface Point `Security::*` constants to `SecurityRequestAttributes::*` ones [Translation] Fix extraction when dealing with VariadicPlaceholder parameters
2 parents 1f91cb4 + a42df13 commit a36cd2d

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Application.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ public function doRun(InputInterface $input, OutputInterface $output)
298298

299299
return isset($event) ? $event->getExitCode() : 1;
300300
}
301+
302+
throw $e;
301303
} catch (NamespaceNotFoundException) {
302304
throw $e;
303305
}

Tests/ApplicationTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\Console\Command\HelpCommand;
1919
use Symfony\Component\Console\Command\LazyCommand;
2020
use Symfony\Component\Console\Command\SignalableCommandInterface;
21+
use Symfony\Component\Console\CommandLoader\CommandLoaderInterface;
2122
use Symfony\Component\Console\CommandLoader\FactoryCommandLoader;
2223
use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
2324
use Symfony\Component\Console\Event\ConsoleCommandEvent;
@@ -1466,6 +1467,25 @@ public function testRunWithError()
14661467
}
14671468
}
14681469

1470+
public function testRunWithFindError()
1471+
{
1472+
$this->expectException(\Error::class);
1473+
$this->expectExceptionMessage('Find exception');
1474+
1475+
$application = new Application();
1476+
$application->setAutoExit(false);
1477+
$application->setCatchExceptions(false);
1478+
1479+
// Throws an exception when find fails
1480+
$commandLoader = $this->createMock(CommandLoaderInterface::class);
1481+
$commandLoader->method('getNames')->willThrowException(new \Error('Find exception'));
1482+
$application->setCommandLoader($commandLoader);
1483+
1484+
// The exception should not be ignored
1485+
$tester = new ApplicationTester($application);
1486+
$tester->run(['command' => 'foo']);
1487+
}
1488+
14691489
public function testRunAllowsErrorListenersToSilenceTheException()
14701490
{
14711491
$dispatcher = $this->getDispatcher();

0 commit comments

Comments
 (0)