10000 bug #26959 [Console] Fix PSR exception context key (scaytrase) · symfony/symfony@2a52963 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2a52963

Browse files
committed
bug #26959 [Console] Fix PSR exception context key (scaytrase)
This PR was merged into the 3.4 branch. Discussion ---------- [Console] Fix PSR exception context key | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26957 | License | MIT | Doc PR | None Fixes context key according to PSR-3 cc. @xabbuh Commits ------- a28393e Fix PSR exception context key
2 parents 8f2132f + a28393e commit 2a52963

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Symfony/Component/Console/EventListener/ErrorListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ public function onConsoleError(ConsoleErrorEvent $event)
4040
$error = $event->getError();
4141

4242
if (!$inputString = $this->getInputString($event)) {
43-
return $this->logger->error('An error occurred while using the console. Message: "{message}"', array('error' => $error, 'message' => $error->getMessage()));
43+
return $this->logger->error('An error occurred while using the console. Message: "{message}"', array('exception' => $error, 'message' => $error->getMessage()));
4444
}
4545

46-
$this->logger->error('Error thrown while running command "{command}". Message: "{message}"', array('error' => $error, 'command' => $inputString, 'message' => $error->getMessage()));
46+
$this->logger->error('Error thrown while running command "{command}". Message: "{message}"', array('exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()));
4747
}
4848

4949
public function onConsoleTerminate(ConsoleTerminateEvent $event)

src/Symfony/Component/Console/Tests/EventListener/ErrorListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testOnConsoleError()
3434
$logger
3535
->expects($this->once())
3636
->method('error')
37-
->with('Error thrown while running command "{command}". Message: "{message}"', array('error' => $error, 'command' => 'test:run --foo=baz buzz', 'message' => 'An error occurred'))
37+
->with('Error thrown while running command "{command}". Message: "{message}"', array('exception' => $error, 'command' => 'test:run --foo=baz buzz', 'message' => 'An error occurred'))
3838
;
3939

4040
$listener = new ErrorListener($logger);
@@ -49,7 +49,7 @@ public function testOnConsoleErrorWithNoCommandAndNoInputString()
4949
$logger
5050
->expects($this->once())
5151
->method('error')
52-
->with('An error occurred while using the console. Message: "{message}"', array('error' => $error, 'message' => 'An error occurred'))
52+
->with('An error occurred while using the console. Message: "{message}"', array('exception' => $error, 'message' => 'An error occurred'))
5353
;
5454

5555
$listener = new ErrorListener($logger);

0 commit comments

Comments
 (0)
0