Error handling for brSEO APIs
If there's an error in an API call, then your customer's browser behaves the same way that it does when it attempts to load a category page that doesn't exist. Bloomreach doesn't redirect your customer to the homepage nor record the timeout parameter.
Common errors are related to timeouts or a theme name that doesn't exist.
We recommend that you redirect HTTP errors to your site's home page.
We recommend that you set the timeout for your thematic pages to 2 seconds.
If there's a timeout during a thematic page load, then we recommend that you redirect your customer with a HTTP 302 response code to your site's home page. Append this specific tracking parameter redirected the URL: ?_thto=1. This parameter serves a few purposes:
It ensures that your customers always receive a page load.
It collects data to assist Bloomreach in troubleshooting timeouts.
For example, let’s say that the following page encounters a timeout error when loading:
Then the site redirects the customer to the home page with a 302 response code, and uses the following URL:
Your Bloomreach TPM can work with you to determine the ideal timeout setting for your requirements.
Bad theme names
If a theme name doesn't exist, then Commerce brSEO sends a 404 error. For example, Dresses by Colette assigns gorgeous-red-cocktail-dresses as the theme name for one of its Thematic Pages.
http://www.example.com/shop/gorgeous-red-cocktail-dresses shows site visitors a Thematic Page called Gorgeous Red Cocktail Dresses.
http://www.example.com/shop/gorgeous-red-cocktail-dress shows site visitors a 404 error because the correct theme name uses the plural form of dress: dresses.
As with all other HTTP errors, we recommend that you redirect the error to your site's home page.
Related categories, related items and related products widgets
Error handling for both timeouts and errors must be in place to have a graceful exit.
If there are timeouts or lookup failures for remote API calls, then you need to omit related categories, related items and related products widgets from category, product and mobile views.
Timeouts are set at 750 milliseconds.
You must set up error handling for scenarios in which an API call returns a non-200 response, such as 404 or 500.
This step is essential, and not at all optional. Error handling is required for responses that aren't 200 (success).