Catch 401 Exception in Angular2
问题 When i try to connect to an unauthorized URL i get in Chrome: zone.js:1274 POST http://localhost:8080/rest/v1/runs 401 (Unauthorized) core.umd.js:3462 EXCEPTION: Response with status: 401 Unauthorized for URL: http://localhost:8080/rest/v1/runs The code of my Home Component is: import {Component, OnInit} from '@angular/core'; import {Run} from "../_models/run"; import {Http, Response} from "@angular/http"; import {RunService} from "../_services/run.service"; import {Observable} from "rxjs";