You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was done to be able to easily add other properties (like debug information) to the error, and avoiding Error (as this isn't consistent between browsers, babel etc.). I agree that it should be changed for all errors, however I'm not sure what makes this error harder to handle, could you clarify?
We use Sentry to handle errors occurring in systems and report them centrally. These will generally verify that a thrown or rejected value is always an Error. Errors are special in that they capture the stacktrace when created, which is essential for tracking down sources of errors.
At https://github.com/algolia/algoliasearch-client-javascript/blob/master/packages/transporter/src/concerns/retryableRequest.ts#L65 a plain object is thrown instead of a proper Error instance.
I am not sure why this is the case, but it results in hard-to-handle exceptions, that gives poor stacktraces and error reporting.
The text was updated successfully, but these errors were encountered: