Added error message

This commit is contained in:
Kevin Frantz 2018-07-15 16:20:06 +02:00
parent 244b18a42f
commit 08f8431407

View File

@ -45,7 +45,11 @@ final class Order extends AbstractDefaultController implements OrderInterface
private function store(): void private function store(): void
{ {
$this->core->getBasket()->setCustomer($this->core->getUser()); $this->core->getBasket()->setCustomer($this->core->getUser());
$this->core->setBasket(new OrderEntity()); if($this->orderRepository->saveOrder($this->core->getBasket())){
$this->core->setBasket(new OrderEntity());
}else{
throw new \Exception('Order could not be saved!');
}
} }
public function basket(): void public function basket(): void