1
I created an Interceptor to catch all errors using angular 6, but catch returns this message.
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>{
return next.handle(req)
.catch((error, caught) => {
(....)
return Observable.throw(errorObj);
}) as any;
};
}
I did a lot of research and found that at angle 6 the:
import { catchError } from 'rxjs/operators';
import { throwError, Observable } from 'rxjs';
Things don’t even work that way around here, though. I also tried the:
import 'rxjs/add/operator/catch';
But the angular says: Module not found: Error: Can’t resolve 'rxjs/add/Operator/catch' in '...'
Read the Rxjs 5.x Upgrade Guide for V6 (in English)
– NoobSaibot
comments there q mark as solved.
– Crane
no, I put the solution down. There was a change in rxjs to add .pipe. But the q m mandate m manual helped to find this solution.
– Crane