RxJS version: 5.1.1
Code to reproduce:
let sub = this.http.get(this.url + 'teams/' + teamId, {
headers: this.headers
})
.retryWhen(error => error.delay(500))
.timeout(2000, new Error('delay exceeded'))
Expected behavior: Should not throw compiler error when using error as a parameter for the timeout method of an observable.
Actual behavior: It throws an error saying that Argument of type 'Error' is not assignable to parameter of type 'IScheduler'.
Additional information: Angular v4
@kwonoj how can I pass data into the timeout error?
@wbhob it is no longer supported to carry forward different error (or any other object) when timeout error is being thrown. If you really need to deliver error other than default timeouterror, you may need .catch() then rethrow by Observable.throw your custom error.
What does that look like (thanks for all your help by the way) @kwonoj
For people who stumble on this later, you can use .timeoutWith(2000, Observable.throw(new Error('delay exceeded'))) 馃槉
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
For people who stumble on this later, you can use
.timeoutWith(2000, Observable.throw(new Error('delay exceeded')))馃槉