algolia / algoliasearch-client-swift

⚑️ A fully-featured and blazing-fast Swift API client to interact with Algolia.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Client side error handling

tottakai opened this issue Β· comments

Is your feature request related to a problem? Please describe πŸ™
When using the AlgoliaSearchClient we would like to determine the error case that the user faced and then inform them in the appropriate manner. But now we are not able to determine the type of errors because they are not available on the client side. So when we call search on an index and there is f.ex. no internet connection the HttpTransport.Error.noReachableHosts is thrown, but we cant match against that since it's not public.

Describe the solution you'd like πŸ€”
Make the Error type usable on client code.

Describe alternatives you've considered ✨
Or convert the Error to a public error type if you don't want to expose that error.

Additional context
The errorDescription is just too long in some case, and too elaborate.