}
} catch (AddToCartException e) {
if (e.getCause() instanceof RequiredAttributeNotProvidedException) {
responseMap.put("error", "allOptionsRequired");
} else if (e.getCause() instanceof ProductOptionValidationException) {
ProductOptionValidationException exception = (ProductOptionValidationException) e.getCause();
responseMap.put("error", "productOptionValidationError");
responseMap.put("errorCode", exception.getErrorCode());
responseMap.put("errorMessage", exception.getMessage());
//blMessages.getMessage(exception.get, lfocale))
} else if (e.getCause() instanceof InventoryUnavailableException) {
responseMap.put("error", "inventoryUnavailable");
} else {
throw e;