Error or exception return from algoliaserach-client-X SDK when quota exceeds

Hello!

I’m currently design a system integrated with Algolia via algoliasearch-client-go. As I’m starting with tight budget, I would have to start with free plan so I would like to design a fallback whenever the quota limit reaches. As stated in the document, my client would receive 403 Forbidden status code but I could not find corresponding errors in the SDK. As I browsed through other languages(python, ruby, etc), no quota limit exceeded error existed either. Not sure if this was by design or not. I was wondering if someone can provide some heads up to me when dealing with this type of error with the official SDK. Thanks for your consideration!

Hi @babygoat,

The errors you can find in this list are “local” errors designed to be thrown by the business logic of the client. The 403 error is a network error, so it’s not explicitly mentioned in the code.

You can base your fallback logic considering that the type of error is errs.AlgoliaErr with Status value is equal to 403.

Thanks for the response!

I will proceed the implementation with your suggestion!