import { HttpInterceptorFn } from "@angular/common/http";
import { throwError } from "rxjs";
import { catchError } from "rxjs/operators";

export const errorInterceptor: HttpInterceptorFn = (req, next) => {
    return next(req).pipe(catchError((err) => throwError(() => {
        console.log(err.error);
        return err.error;
    })));
};
