Closed tristanmkernan closed 6 years ago
Did you try to use catch on the observable to see if it catches anything?
i tried the catch operator, but it did not work.
per http://reactivex.io/documentation/operators/catch.html
The Catch operator intercepts an onError notification from the source Observable and, instead of passing it through to any observers, replaces it with some other item or sequence of items, potentially allowing the resulting Observable to terminate normally or not to terminate at all.
in a previous version of your code (2.2.2), i had resolved the issue by changing this code
https://github.com/ngx-translate/core/blob/master/src/translate.service.ts#L190
to include an onError
that did nothing. the error was then propagated to my error handler function.
@russon77 did you manage to find a workaround for this?
Hello, I'm closing this issue because it's too old. If you have a similar problem with recent version of the library, please open a new issue.
I'm submitting a ... (check one with "x")
Current behavior
when a translation is requested in
translateService.use('lang')
, if the language is not found (i.e. 404), there is an uncaught exception that is not propagated to supplied error handler.error
is never reached.Expected/desired behavior
no uncaught exception, error is called.
Reproduction of the problem If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:btpW3l0jr5beJVjohy1Q).
delete your set translation dictionary and refresh the page.
What is the motivation / use case for changing the behavior?
correct error handling for cases where retrieving the dictionary file fails, whether it's due to network conditions or whatever. i would also like to be able to display a notification on screen when the request fails.
Please tell us about your environment: