Repository navigation
Argument of type 'Error' is not assignable to parameter of type 'Scheduler' #3672
Description
Activity
A timeout always throws a Rx.TimeoutError with the latest rxjs. So the error parameter is unnecessary.
@clydin thanks - what if i want to modify what it says ? :)
I'm interested too. I opened a same related question on stackoverflow
http://stackoverflow.com/questions/41320125/how-to-implement-http-post-timeout-wth-last-rjxs-version
@peterpeterparker I can see that you updated your question/answer yesterday on stackoverflow. I am still not sure how can you throw a custom error message with that? (If I dont want to check error message in subscribe method).
@hassanasad I don't know neither except by checking the error in the error part, but at least, it works again ;)
Sorry but this isn't a CLI problem so I'll have to close it. Stack Overflow is a good place to ask.
@hassanasad Do you find any solution for this ?
I changed my code as follows (it doesn't necessarily solve the issue but i got over it):
// Get data from server httpGet( URL: string, requestOptions = this.getRequestOptions() ): Observable<any> { let tried = 0; return this.http.get(URL, requestOptions) .retryWhen(error => { // Retry when error.status is NOT 500 return error .switchMap((error) => { tried++; // If number of tried are over - throw error in each case if ( tried >= 4 ) return Observable.throw(error); // Retry if error.status is NOT 500 otherwise try again return (error.status === 500) ? Observable.throw(error) : Observable.of(error); }) .delay( 500 ) // Number of miliseconds between each retry .take( 4 ); // Number of tries }) .timeout( 30000 ) // Total number of miliseconds to throw timeout error .map(this.extractData) .catch(this.handleError); }Reacted by iamjoyceangular-automatic-lock-bot commented
on Sep 7, 2019 More actionsThis issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
- locked and limited conversation to collaborators
on Sep 7, 2019
OS?
Versions.
After the update to angular-cli beta 24 i started getting this error:
This is the code in context:
If i comment line 22 everything works fine. However, i do want to throw that error of timeout. Any suggestions please?