Fix PSR exception context key
This commit is contained in:
parent
8f2132fce3
commit
a28393e482
@ -40,10 +40,10 @@ class ErrorListener implements EventSubscriberInterface
|
||||
$error = $event->getError();
|
||||
|
||||
if (!$inputString = $this->getInputString($event)) {
|
||||
return $this->logger->error('An error occurred while using the console. Message: "{message}"', array('error' => $error, 'message' => $error->getMessage()));
|
||||
return $this->logger->error('An error occurred while using the console. Message: "{message}"', array('exception' => $error, 'message' => $error->getMessage()));
|
||||
}
|
||||
|
||||
$this->logger->error('Error thrown while running command "{command}". Message: "{message}"', array('error' => $error, 'command' => $inputString, 'message' => $error->getMessage()));
|
||||
$this->logger->error('Error thrown while running command "{command}". Message: "{message}"', array('exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()));
|
||||
}
|
||||
|
||||
public function onConsoleTerminate(ConsoleTerminateEvent $event)
|
||||
|
@ -34,7 +34,7 @@ class ErrorListenerTest extends TestCase
|
||||
$logger
|
||||
->expects($this->once())
|
||||
->method('error')
|
||||
->with('Error thrown while running command "{command}". Message: "{message}"', array('error' => $error, 'command' => 'test:run --foo=baz buzz', 'message' => 'An error occurred'))
|
||||
->with('Error thrown while running command "{command}". Message: "{message}"', array('exception' => $error, 'command' => 'test:run --foo=baz buzz', 'message' => 'An error occurred'))
|
||||
;
|
||||
|
||||
$listener = new ErrorListener($logger);
|
||||
@ -49,7 +49,7 @@ class ErrorListenerTest extends TestCase
|
||||
$logger
|
||||
->expects($this->once())
|
||||
->method('error')
|
||||
->with('An error occurred while using the console. Message: "{message}"', array('error' => $error, 'message' => 'An error occurred'))
|
||||
->with('An error occurred while using the console. Message: "{message}"', array('exception' => $error, 'message' => 'An error occurred'))
|
||||
;
|
||||
|
||||
$listener = new ErrorListener($logger);
|
||||
|
Reference in New Issue
Block a user