-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix(typeahead): Typeahead, Observable error callback. When API call fails, application stops working #1956
Comments
I'm putting the code that is responsible for this here
|
Am also having the same issue, when API call fails, application breaks. Doesn't work till refresh the application. |
I have a simmilar issue. My API call fails and application breaks when I have set |
Hi! |
@krooshua I tried your solution and it didn't work for me :/ API still returns an error and the application breaks and won't send any more requests. I solved this by simply adding catch to Observable like this:
This works for me but there must be a better solution. |
Typeahead doesn't do any http requests itself, it only takes an Observable as input. So all http errors should be handled outside if this component. |
Http error is not the point of this issue. The point is that it shouldn't do anything if input length is less than 3 if typeaheadMinLength="3", it shouldn't accept it as an input and it does. Works perfectly fine if you type slowly enough for the debounce to catch it but if you type any faster it fails. I think there should be some additional input length check. |
@IlyaSurmay you haven't let the developers exactly handle those errors outside your component. Check the code it's right in front of you. |
@astroanu my bad :( We'll come up with plunkr that shows how to handle errors or PR that fixes the issue |
@astroanu Hi! Do you still have this issue? Typeahead component has had a lot of changes since 2017. I added PR with a new demo for async typeahead. It's not merged yet but you can check how I handle http error. I'm going to close the issue because it's not the issue anymore. |
How do i write an error callback when the typehead is bound to an http observable. Currently it just prints an error on to the console and the component stops working. My typehead is fetching options by calling a remote url, if the remote server fails i want to show a message to the user.
The text was updated successfully, but these errors were encountered: