Throwing Application-specific Errors .catch

private handleError(error: Response) {

if (error.status === 400) return throwError(new BadInput(error.json()));

if (error.status === 404) return throwError(new NotFoundError());

return throwError(new AppError(error.json()));

}

4 Likes