-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation about the ajax callback is confusing #315
Comments
more important is |
But the provided implementation does not actually report such errors as it does not seem to be calling the callback when an error happens. Or am I missing something? |
like said...status is all that counts...read the code |
When an exception happens, the callback is not called. It would probably be better to call it than to just log to the console. I'll try to create a PR for this and also improve the documentation a bit. It confused me at least. We can then discuss whether that's really an improvement :) |
and what you like todo with the error? -> which only can be a network error (offline)...all other cases are handled with a retry or permanent fail which gets handled in the i18next events / callbacks |
Reporting it to the caller with "no retry" seems most natural to me. |
PR welcome |
The README says that the
ajax
parameter takes acallback
that should be called as follows:However, that's not what the included implementation does. When there is an error, it logs to the console and never calls the callback.
I tried to actually call with
null
on error and that did not work for me (at least not with the local storage backend in the next layer of a chained backend.) I could provide a minimal example if that helps here.So, what is the right thing to do here? Just not call the callback as the default implementation does? Then the documentation should be updated.
The text was updated successfully, but these errors were encountered: