Skip to content
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

Errors not propagating #684

Closed
chancezeus opened this issue Sep 27, 2017 · 1 comment
Closed

Errors not propagating #684

chancezeus opened this issue Sep 27, 2017 · 1 comment

Comments

@chancezeus
Copy link

I'm submitting a ... (check one with "x")

[X] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request

Current behavior
When setting using translateService.use(translateService.getBrowserLang()).subscribe it is impossible to handle errors since there is no error handler defined in the observer inside the service (see ReactiveX/rxjs#2145 for a bug report which explains why this is the case).

Expected/desired behavior
The error handler of the subscriber in my code is called so I can reset the language to one of the known/working languages (or (better option) the service handles this internally resetting the current language to either the previous language or the default language).

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:WccVZSBM0rUgq2sXSUbe

http://plnkr.co/edit/lNmVAFcneFm86CwuAagP?p=preview

What is the expected behavior?
Alert is shown because "non_existing_language" can not be loaded

What is the motivation / use case for changing the behavior?
Handling dynamic loading of (future) languages from a server environment instead of only relying on locally available languages.

Please tell us about your environment:

  • ngx-translate version: 8.0.0

  • Angular version: 4.3.6

  • Browser: all

@chancezeus chancezeus changed the title Errors not propagationg Errors not propagating Sep 27, 2017
@CodeAndWeb
Copy link
Member

Duplicate: #751

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants