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
{{ message }}
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.
Currently if there are any errors from http.get (e.g. the file does not exist) the error is propagated to the top level of the app and there's no way to catch it.
I suggest support for adding an error handler function -- something like:
constructor(private http: HttpClient, public prefix: string = "/assets/i18n/", public suffix: string = ".json", public errorHandler?: () => any) {}
public getTranslation(lang: string): any {
const obs = this.http.get(url);
if (this.errorHandler) {
obs.catch(this.errorHandler);
}
return obs;
}
The text was updated successfully, but these errors were encountered:
I have also encountered the same problem. This is reproducable if you pass an locale to translate.use which has no translations file. This raises an http error but the error part of the Observable of translate.use is not called.
Currently if there are any errors from
http.get
(e.g. the file does not exist) the error is propagated to the top level of the app and there's no way to catch it.I suggest support for adding an error handler function -- something like:
The text was updated successfully, but these errors were encountered: