Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function execute(Command $command)
 {
     $handler = $this->resolver->resolve($command);
     try {
         $handler->handle($command);
     } catch (Exception $exception) {
         throw CommandException::create($exception->getMessage(), $exception);
     }
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function execute(Command $command)
 {
     try {
         $timetamp = DateTime::now();
         $messageId = MessageId::generate();
         $metaData = new MetaData();
         $this->pipe(new DomainCommandMessage($messageId, $timetamp, $command, $metaData));
     } catch (Exception $exception) {
         throw CommandException::create($exception->getMessage(), $exception);
     }
 }
Exemplo n.º 3
0
 public function test_that_create_returns_exception_instance()
 {
     $exception = CommandException::create('Command error');
     $this->assertInstanceOf('Novuso\\Common\\Application\\Messaging\\Command\\Exception\\CommandException', $exception);
 }