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 errors, thrown immediately when an error occurs, async errors are typically passed to a callback function or returned as a promise rejection. This 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 products with the specified ID(s) could not be found. 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. This 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 the product database is not synchronized with the service consuming it, leading to discrepancies in product IDs.

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

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. This 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 the locale to be formatted 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 and cannot be resolved, 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