Class BroadleafWebServicesException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.broadleafcommerce.rest.api.exception.BroadleafWebServicesException
- All Implemented Interfaces:
Serializable
The purpose of this is to allow REST endpoints to build an exception with
- Author:
- Kelly Tisdell
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Localestatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMessage(String key) Convenience method for adding a message with no parametersaddMessage(String key, Object param) Convenience method for adding a message with a single parameteraddMessage(String key, Object[] params) Convenience mentod for adding a message with multiple parametersaddTranslatedMessage(String key, String message) Adds a translated message.build(int httpStatusCode) intReturns the intended HTTP status code (e.g.Returns thejava.util.Localethat messages should be formatted in.Gets a map of message keys and object arrays.Gets a map of messages that have already been translated.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
UNKNOWN_ERROR
- See Also:
-
NOT_FOUND
- See Also:
-
PRODUCT_NOT_FOUND
- See Also:
-
CATEGORY_NOT_FOUND
- See Also:
-
SKU_NOT_FOUND
- See Also:
-
SEARCH_ERROR
- See Also:
-
SEARCH_QUERY_EMPTY
- See Also:
-
SEARCH_QUERY_MALFORMED
- See Also:
-
INVALID_CATEGORY_ID
- See Also:
-
CART_NOT_FOUND
- See Also:
-
CART_CUSTOMER_MISMATCH
- See Also:
-
CART_ITEM_NOT_FOUND
- See Also:
-
CART_PRICING_ERROR
- See Also:
-
UPDATE_CART_ERROR
- See Also:
-
PROMO_CODE_MAX_USAGES
- See Also:
-
PROMO_CODE_INVALID
- See Also:
-
PROMO_CODE_EXPIRED
- See Also:
-
PROMO_CODE_ALREADY_ADDED
- See Also:
-
FULFILLMENT_GROUP_NOT_FOUND
- See Also:
-
FULFILLMENT_OPTION_NOT_FOUND
- See Also:
-
CUSTOMER_NOT_FOUND
- See Also:
-
CUSTOMER_EMAIL_NOT_FOUND
- See Also:
-
CUSTOMER_ADDRESS_NOT_FOUND
- See Also:
-
CHECKOUT_PROCESSING_ERROR
- See Also:
-
CONTENT_TYPE_NOT_SUPPORTED
- See Also:
-
METHOD_NOT_SUPPORTED
- See Also:
-
QUERY_PARAMETER_NOT_PRESENT
- See Also:
-
QUERY_PARAMETER_MISMATCH
- See Also:
-
QUERY_PARAMETER_RESOLUTION
- See Also:
-
QUERY_PARAMETER_NOT_VALID
- See Also:
-
QUERY_PARAMETER_NOT_READABLE
- See Also:
-
CUSTOMER_PAYMENT_NOT_FOUND
- See Also:
-
INVALID_CUSTOMER_FOR_PAYMENT
- See Also:
-
INVALID_ADD_TO_CART_REQUEST
- See Also:
-
MISSING_ITEM_NAME
- See Also:
-
CUSTOMER_PAYMENT_ORDER_MISMATCH
- See Also:
-
ORDER_PAYMENT_NOT_FOUND
- See Also:
-
INVALID_ORDER_PAYMENT_FOR_ORDER
- See Also:
-
INVALID_FULFILLMENT_GROUP_FOR_ORDER
- See Also:
-
INVALID_ENUMERATION_VALUE_EXCEPTION
- See Also:
-
httpStatusCode
protected int httpStatusCode -
messages
-
translatedMessages
-
locale
-
-
Constructor Details
-
BroadleafWebServicesException
-
-
Method Details
-
build
-
build
-
build
-
build
-
build
public static BroadleafWebServicesException build(int httpStatusCode, Locale locale, Map<String, Object[]> messages) -
build
-
getHttpStatusCode
public int getHttpStatusCode()Returns the intended HTTP status code (e.g. 400, 403, 404, 500, etc...). Default is 500.- Returns:
-
getMessages
Gets a map of message keys and object arrays. These will generally be used to build a an internationalized message in the response. The map key is typically going to be a message bundle key, and the object array provides parameters for the message. For more information, see Spring'sorg.springframework.context.MessageSource.- Returns:
-
getTranslatedMessages
Gets a map of messages that have already been translated. BLC provides a number of translation mechanisms for entities in the DB.- Returns:
-
addTranslatedMessage
Adds a translated message. The assumption is that the message added to this map does not need to be translated or internationalized any further. It is already translated according to the user's Locale.- Parameters:
key-message-- Returns:
-
addMessage
Convenience method for adding a message with no parameters- Parameters:
key-- Returns:
-
addMessage
Convenience method for adding a message with a single parameter- Parameters:
key-param-- Returns:
-
addMessage
Convenience mentod for adding a message with multiple parameters- Parameters:
key-params-- Returns:
-
getLocale
Returns thejava.util.Localethat messages should be formatted in.- Returns:
-