What's the observable equivalent to `Promise.reject` What's the observable equivalent to `Promise.reject` angular angular

What's the observable equivalent to `Promise.reject`


private handleError(error: any) {    return Observable.throw('Some error information');}

See also How to catch exception correctly from http.request()?


With RxJS 6 Observable.throw() has changed to throwError()

Observable.throw(new Error());// becomesthrowError(new Error());

Source: RxJS v5.x to v6 Update Guide - Depracations