mirror of
				https://github.com/kevinveenbirkenbach/coding-challenge-online-shop.git
				synced 2025-11-04 02:57:57 +00:00 
			
		
		
		
	Added error message
This commit is contained in:
		@@ -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());
 | 
				
			||||||
 | 
					        if($this->orderRepository->saveOrder($this->core->getBasket())){
 | 
				
			||||||
            $this->core->setBasket(new OrderEntity());
 | 
					            $this->core->setBasket(new OrderEntity());
 | 
				
			||||||
 | 
					        }else{
 | 
				
			||||||
 | 
					            throw new \Exception('Order could not be saved!');
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function basket(): void
 | 
					    public function basket(): void
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user