发送跨域请求选项方法时是否有可能捕获到错误?
这是代码段
import { ajax } from 'rxjs/observable/dom/ajax';
import 'rxjs/add/operator/catch';
ajax.getJSON(XXXX)
.catch(err => {
const { xhr } = err;
if (xhr.status === 0) {
window.console.log('Server is not responding');
} else {
window.console.log(xhr);
}
return Observable.of();
});
我不希望在控制台中显示此错误: