/**
  * @test
  */
 public function it_will_return_exception_details_straight_away()
 {
     $exception = new \Exception();
     $expected = ['abc' => '123'];
     $this->messageSerializer->serializeException($exception)->willReturn($expected);
     $actual = $this->SUT->serializeException($exception);
     $this->assertEquals($expected, $actual);
 }
 /**
  * @param ActionEvent $event
  */
 public function onErrorCommand(ActionEvent $event)
 {
     $exception = $event->getParam(MessageBus::EVENT_PARAM_EXCEPTION);
     $command = $event->getParam(MessageBus::EVENT_PARAM_MESSAGE);
     $data = $this->messageSerializer->serializeCommand($command);
     $data['success'] = false;
     if ($exception instanceof \Exception) {
         $data['exception'] = $this->messageSerializer->serializeException($exception);
     }
     $this->logger->error(json_encode($data));
 }