Skip to content

Commit a28393e

Browse files
author
Pavel.Batanov
committed
Fix PSR exception context key
1 parent 8f2132f commit a28393e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

+2-2
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

+2-2
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)