Class InventoryUnavailableException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.broadleafcommerce.cartoperation.domain.InventoryUnavailableException
- All Implemented Interfaces:
Serializable
Exception to indicate that inventory was unavailable, typically after trying to reserve
inventory.
- Author:
- Kelly Tisdell
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInventoryUnavailableException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, Map<String, String> itemFailureMessages) InventoryUnavailableException(String message, Throwable cause, Map<String, String> itemFailureMessages) InventoryUnavailableException(String message, Map<String, String> itemFailureMessages) InventoryUnavailableException(Throwable cause, Map<String, String> itemFailureMessages) InventoryUnavailableException(Map<String, String> itemFailureMessages) -
Method Summary
Modifier and TypeMethodDescriptionLine item error messages to indicate which cart items were unavailable.Get the error response body if this was aresponse error.booleanReturns true if this error was caused by lack of inventory availability.booleanReturns true if the exception was caused by a request error (e.g.booleanvoidsetAvailabilityError(boolean availabilityError) Returns true if this error was caused by lack of inventory availability.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
InventoryUnavailableException
-
InventoryUnavailableException
-
InventoryUnavailableException
-
InventoryUnavailableException
-
InventoryUnavailableException
-
-
Method Details
-
isRequestError
public boolean isRequestError()Returns true if the exception was caused by a request error (e.g. timeout, connection refused, etc.)- Returns:
- true if there was an error communicating with the inventory service.
-
isResponseError
public boolean isResponseError()- Returns:
- true if the cause of this error was a web client response error.
-
getRequestErrorType
- Returns:
- An error type if the exception was caused by a request error.
-
getResponseBody
Get the error response body if this was aresponse error.- Returns:
- The API response body. If no body or this wasn't a response error, returns an empty map.
-
isAvailabilityError
public boolean isAvailabilityError()Returns true if this error was caused by lack of inventory availability. -
getItemFailureMessages
Line item error messages to indicate which cart items were unavailable. These are typically identified byCartItemids.- Returns:
- Line item error messages used to describe issues with individual fields, cart items, etc.
-
setAvailabilityError
public void setAvailabilityError(boolean availabilityError) Returns true if this error was caused by lack of inventory availability.
-