i18next / i18next-http-backend

i18next-http-backend is a backend layer for i18next using in Node.js, in the browser and for Deno.
MIT License
452 stars 70 forks source link

Have a way to handle errors #138

Closed eMerzh closed 6 months ago

eMerzh commented 6 months ago

Hello,

It seems that for some reasons, sometimes, we can't load the translations,

🚀 Feature Proposal

it's nice to be able to manage the loading error with some kind of callback like onError with url, error ?

Motivation

To be able to debug why client can't load stuff, without completely customizing the request or lib

Example

adrai commented 6 months ago

set debug to true and check the console logs or listen for this: https://www.i18next.com/overview/api#onfailedloading

eMerzh commented 6 months ago

oh thanks ... is the debug mandatory? because i would like to enable that on prod using tools like sentry

adrai commented 6 months ago

no it's not mandatory