move form exception in Form namespace
This commit is contained in:
@@ -34,7 +34,6 @@ use Thelia\Model\ProductPriceQuery;
|
||||
use Thelia\Model\CartItem;
|
||||
use Thelia\Model\CartItemQuery;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Thelia\Action\Exception\FormValidationException;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -53,7 +52,6 @@ class Cart extends BaseAction implements EventSubscriberInterface
|
||||
public function addArticle(CartEvent $event)
|
||||
{
|
||||
|
||||
|
||||
$cart = $event->cart;
|
||||
$newness = $event->newness;
|
||||
$append = $event->append;
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Action\Exception;
|
||||
|
||||
class ActionException extends \RuntimeException
|
||||
{
|
||||
|
||||
}
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
<route id="cart.add.process" path="/cart/add">
|
||||
<default key="_controller">Thelia\Controller\Front\CartController::addArticle</default>
|
||||
<default key="_view">cart</default>
|
||||
</route>
|
||||
|
||||
<route id="cart.change.process" path="/cart/delete">
|
||||
|
||||
@@ -33,7 +33,7 @@ use Thelia\Core\Event\ActionEvent;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
use Thelia\Core\Factory\ActionEventFactory;
|
||||
use Thelia\Form\BaseForm;
|
||||
use Thelia\Action\Exception\FormValidationException;
|
||||
use Thelia\Form\Exception\FormValidationException;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
namespace Thelia\Controller\Front;
|
||||
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Action\Exception\FormValidationException;
|
||||
use Thelia\Form\Exception\FormValidationException;
|
||||
use Thelia\Core\Event\CartEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@@ -54,10 +54,10 @@ class CartController extends BaseFrontController
|
||||
|
||||
$this->redirectSuccess();
|
||||
|
||||
} catch(PropelException $e) {
|
||||
} catch (PropelException $e) {
|
||||
\Thelia\Log\Tlog::getInstance()->error(sprintf("Failed to add item to cart with message : %s", $e->getMessage()));
|
||||
$message = "Failed to add this article to your cart, please try again";
|
||||
} catch(FormValidationException $e) {
|
||||
} catch (FormValidationException $e) {
|
||||
$message = $e->getMessage();
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
namespace Thelia\Core\Event;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Thelia\Core\HttpFoundation\Request;
|
||||
use Thelia\Model\Cart;
|
||||
|
||||
class CartEvent extends Event
|
||||
|
||||
@@ -24,8 +24,8 @@ namespace Thelia\Form;
|
||||
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
use Symfony\Component\Validator\ExecutionContextInterface;
|
||||
use Thelia\Action\Exception\StockNotFoundException;
|
||||
use Thelia\Action\Exception\ProductNotFoundException;
|
||||
use Thelia\Form\Exception\StockNotFoundException;
|
||||
use Thelia\Form\Exception\ProductNotFoundException;
|
||||
use Thelia\Model\ProductSaleElementsQuery;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Thelia\Model\ProductQuery;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Action\Exception;
|
||||
namespace Thelia\Form\Exception;
|
||||
|
||||
class FormValidationException extends ActionException
|
||||
class FormValidationException extends \RuntimeException
|
||||
{
|
||||
}
|
||||
@@ -21,8 +21,8 @@
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Action\Exception;
|
||||
namespace Thelia\Form\Exception;
|
||||
|
||||
class ProductNotFoundException extends ActionException
|
||||
class ProductNotFoundException extends FormValidationException
|
||||
{
|
||||
}
|
||||
@@ -21,9 +21,9 @@
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Action\Exception;
|
||||
namespace Thelia\Form\Exception;
|
||||
|
||||
class StockNotFoundException extends ActionException
|
||||
class StockNotFoundException extends FormValidationException
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user