public function errorAction()
{
try {
$order = $this->getPaymentHandler()->handleError($this->getRequest(), $this->getBasket());
} catch (EntityNotFoundException $ex) {
throw new NotFoundHttpException($ex->getMessage());
} catch (InvalidTransactionException $ex) {
throw new UnauthorizedHttpException($ex->getMessage());
}
return $this->render('SonataPaymentBundle:Payment:error.html.twig', array('order' => $order));
}