Error codes and error messages

When an error or exception occurs in the Optimization service, the exception contains the error code, error code message, and reason for the exception.

If an exception occurs in the Optimization service, a OTMZOPTE exception occurs.

Error code categories

Table 1. Error code categories
Error Codes Description
OTMZGNE - General application errors General application error codes.
OTMZOPTE - Optimization service errors the Optimization service error codes.
OTMZRNE - Rank API errors Rank API errors.
WOORE - Optimization Explainer API errors The optimization explainer API errors.

Examples of possible exceptions

Table 2. Possible exceptions
Exception or response Reason
OTMZException
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<errorCode>OTMZOPTE011</errorCode>
<errorCodeMessage>Sku '46448325' exceeds weight limit</errorCodeMessage>
<reason>com.ibm.commerce.inbalance.baseapi.OTMZException: 
Sku 46448325 has weight 200.7 more than 150 lbs.</reason>
</error>
The weight of SKU 46448325 is 200.7 lbs. This amount exceeds the limit of 150 lbs.
When the Optimization service service is down:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<errorCode>OTMZWEB004</errorCode>
<errorCodeMessage> Service not available</errorCodeMessage>
</error>
The Optimization service service is unavailable. Try again later.

Examples of the response

Example 1: When the Tenant ID value is missing from the otmz.webclient.property file.

OTMZwebClientException.getErrorCode()=OTMZWEB001
OTMZwebClientException.getErrorMessage()=Property not found Exception
OTMZwebClientException.getReason ()= “Tenant ID is missing from otmz.webclient.property file” 

Example 2: When the Optimization service endpoint value is missing from the otmz.webclient.property file.

OTMZwebClientException.getErrorCode()=OTMZWEB001
OTMZwebClientException.getErrorMessage()=Property not found Exception
OTMZwebClientException.getReason ()= “Optimizer endpoint is missing from otmz.webclient.property file”

Example 3: When the otmz.webclient.property file is missing or is not loaded.

OTMZwebClientException.getErrorCode()=OTMZWEB005
OTMZwebClientException.getErrorMessage()=File not found
OTMZwebClientException.getReason ()= “Unable to find otmz.webclient.property file”