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 }}
Repository navigation
Argument of type 'Error' is not assignable to parameter of type 'Scheduler' #3672
After the update to angular-cli beta 24 i started getting this error:
ERROR in ./src/app/shared/services/baseapi.service.ts
Module build failed: Error: /Users/hassan/Code/project/src/app/shared/services/baseapi.service.ts (22,20): Argument of type 'Error' is not assignable to parameter of type 'Scheduler'.
Property 'SchedulerAction' is missing in type 'Error'.)
/Users/hassan/Code/project/src/app/shared/services/baseapi.service.ts (43,20): Argument of type 'Error' is not assignable to parameter of type 'Scheduler'.)
at _checkDiagnostics (/Users/hassan/Code/project/node_modules/@ngtools/webpack/src/loader.js:116:15)
at /Users/hassan/Code/project/node_modules/@ngtools/webpack/src/loader.js:141:17
@ ./src/app/shared/services/user.service.ts 18:0-51
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi main
@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).
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 iamjoyce
angular-automatic-lock-bot commented on Sep 7, 2019
Activity
clydin commentedon Dec 21, 2016
A timeout always throws a Rx.TimeoutError with the latest rxjs. So the error parameter is unnecessary.
hassanasad commentedon Dec 21, 2016
@clydin thanks - what if i want to modify what it says ? :)
peterpeterparker commentedon Dec 25, 2016
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
hassanasad commentedon Dec 27, 2016
@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).
peterpeterparker commentedon Dec 27, 2016
@hassanasad I don't know neither except by checking the error in the error part, but at least, it works again ;)
filipesilva commentedon Dec 30, 2016
Sorry but this isn't a CLI problem so I'll have to close it. Stack Overflow is a good place to ask.
roshenpo007 commentedon Nov 28, 2017
@hassanasad Do you find any solution for this ?
hassanasad commentedon Nov 28, 2017
I changed my code as follows (it doesn't necessarily solve the issue but i got over it):
angular-automatic-lock-bot commentedon Sep 7, 2019
This 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.