Description:
There is an inconsistency in how the i18next-http-backend plugin handles network errors across different browsers. The current implementation checks for specific error messages to determine whether to retry a failed request. However, different browsers return different error messages, leading to inconsistent behavior.
Steps to Reproduce:
Use the i18next-http-backend plugin in a project.
Simulate a network failure (e.g., by disconnecting from the internet or blocking the request).
Observe the error messages in different browsers:
Chrome: "Failed to fetch"
Firefox: "NetworkError when attempting to fetch resource."
Safari: "Load failed"
Expected Behavior:
The plugin should consistently identify network-related errors and decide whether to retry the request, regardless of the browser being used.
Actual Behavior:
The plugin's error handling logic is inconsistent due to different error messages returned by various browsers.
Proposed Solution:
Modify the error-checking logic to account for the different error messages across browsers. Here is a suggested revision:
Additional Context:
This issue affects the reliability of the plugin in handling network errors, which can impact the user experience by either failing to retry requests when appropriate or retrying unnecessarily.
Description: There is an inconsistency in how the
i18next-http-backend
plugin handles network errors across different browsers. The current implementation checks for specific error messages to determine whether to retry a failed request. However, different browsers return different error messages, leading to inconsistent behavior.Steps to Reproduce:
i18next-http-backend
plugin in a project.Expected Behavior: The plugin should consistently identify network-related errors and decide whether to retry the request, regardless of the browser being used.
Actual Behavior: The plugin's error handling logic is inconsistent due to different error messages returned by various browsers.
Proposed Solution: Modify the error-checking logic to account for the different error messages across browsers. Here is a suggested revision:
Reference to the code: https://github.com/i18next/i18next-http-backend/blob/master/lib/index.js#L77
Environment:
i18next-http-backend
version: 2.6.1Additional Context: This issue affects the reliability of the plugin in handling network errors, which can impact the user experience by either failing to retry requests when appropriate or retrying unnecessarily.