import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.mxchange.jcoreee.beans.BaseFrameworkBean;
+import org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException;
import org.mxchange.jshopcore.model.category.Category;
import org.mxchange.jshopcore.model.category.CategorySessionBeanRemote;
try {
// Deligate to bean
this.category.doAdminAddCategory(category);
- } catch (final RemoteException ex) {
+ } catch (final CategoryTitleAlreadyUsedException | RemoteException ex) {
// Continue to throw
throw new FaceletException(ex);
}
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.mxchange.jcoreee.beans.BaseFrameworkBean;
+import org.mxchange.jshopcore.exceptions.ProductTitleAlreadyUsedException;
import org.mxchange.jshopcore.model.product.Product;
import org.mxchange.jshopcore.model.product.ProductSessionBeanRemote;
@Override
public void doAdminAddProduct (final Product product) throws FaceletException {
- // Call bean
- this.product.doAdminAddProduct(product);
+ try {
+ // Call bean
+ this.product.doAdminAddProduct(product);
+ } catch (final ProductTitleAlreadyUsedException ex) {
+ // Continue to throw
+ throw new FaceletException(ex);
+ }
}
@Override