diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php
index 41c2a238e0..9cebe5768b 100644
--- a/src/Symfony/Component/Console/Application.php
+++ b/src/Symfony/Component/Console/Application.php
@@ -761,7 +761,9 @@ class Application
}
$messages = array();
- $messages[] = sprintf('%s', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a')));
+ if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
+ $messages[] = sprintf('%s', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a')));
+ }
$messages[] = $emptyLine = sprintf('%s', str_repeat(' ', $len));
if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
$messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::strlen($title))));
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt
index 700ffada3d..1df5bd6494 100644
--- a/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt
+++ b/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt
@@ -1,5 +1,4 @@
-In Application.php line 615:
Command "foo" is not defined.
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt
index 457e6df46c..932063d730 100644
--- a/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt
+++ b/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt
@@ -1,5 +1,4 @@
-In ArrayInput.php line 178:
The "--foo" option does not exist.
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt
index 040564447f..548a13e56f 100644
--- a/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt
+++ b/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt
@@ -1,5 +1,4 @@
-In Application.php line 615:
Command "foo" is not define
d.