Async error objects

Understand async error objects.

When Admin API detects an asynchronous error, it returns the errors object in the response. This object will return the code and description.

Async error objects represent errors that occur during asynchronous operations. Unlike synchronous mistakes, which appear immediately when an error occurs, async errors are typically passed to a callback function or returned as a promise rejection. It allows for more flexible error handling in non-blocking, asynchronous programming. Understanding handling async error objects is crucial for building resilient and user-friendly applications.

PRODUCT_NOT_FOUND

The PRODUCT_NOT_FOUND error indicates that the system could not find the products with the specified IDs. It's essential to verify the product ID(s) are correct and try the operation again.

Example

"errors": [
  {
    "code": "PRODUCT_NOT_FOUND,"
    "description": "Cannot find the product, productId1, productId2. The specified product IDs could not be found. Provide the correct product ID and try again."
  }
}

The PRODUCT_NOT_FOUND error can occur in various scenarios, including but not limited to:

  • Invalid product IDs: When product IDs provided in a request do not exist in the database. It could be due to typos or incorrect IDs.

  • Deleted or unavailable products: If the product has been removed from the inventory or is temporarily unavailable.

  • Data synchronization issues: In cases where there is a mismatch between the product database and the service using it due to synchronization issues, product ID discrepancies may occur.

  • Case sensitivity mismatches: When the input does not match the case of the product IDs stored in the system, which are case-sensitive.

To resolve this error:

  • Double-check product IDs: Ensure your product IDs match those in your database or product management system. Typos or incorrect IDs are a common mistake.

  • Verify product availability: Sometimes, products may be removed or their IDs updated. Verify that the products are still available and their IDs haven't changed.

  • Case sensitivity: In some systems, product IDs may be case-sensitive. Ensure that the case matches exactly.

Avoiding these common pitfalls and following the troubleshooting steps should help resolve the PRODUCT_NOT_FOUND error.

LOCALE_NOT_PROVIDED

The LOCALE_NOT_PROVIDED error indicates that the request is missing the required locale information. It is essential for operations that depend on locale-specific data. To resolve this error, include the necessary locale information in your request.

Example

"errors": [
{
"code": "LOCALE_NOT_PROVIDED",
"description": "A locale is required. Provide the locale and try again."
}
]

To resolve this error:

  • Specify locale in request: Always include the locale parameter in your request. For example, for US English, you should add "locale": "en_US".

  • Check documentation for required locale format: Different systems may require you to format the locale in specific ways. Check the API or system documentation for the correct format.

  • Locale support: Ensure that the system or API you interact with supports the locale you specify. Not all systems support all locales.

  • Contact support: If you encounter an API error that keeps occurring, you should create a case in the Solution Center. You can contact your CSM for more help or escalate the issue if necessary. In addition, if we log the error on our system, we may have monitoring set up to automatically create a case when a particular error occurs multiple times within a specific timeframe to help us investigate and address the issue promptly.

Avoiding these common pitfalls and following the troubleshooting steps should help resolve the LOCALE_NOT_PROVIDED error.

Last updated