本文整理匯總了TypeScript中rxjs/Subject.Subject.error方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Subject.error方法的具體用法?TypeScript Subject.error怎麽用?TypeScript Subject.error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rxjs/Subject.Subject
的用法示例。
在下文中一共展示了Subject.error方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: VirtualContainerHost
.subscribe(data => {
try {
for (const objectId in data.data) {
if (data.data.hasOwnProperty(objectId)) {
vchsArray.push(new VirtualContainerHost(data.data[objectId]));
}
}
} catch (e) {
this.vchsSubj.error(e);
return;
}
this.vchsSubj.next(vchsArray);
});
示例2: ContainerVm
.subscribe(data => {
try {
for (const objectId in data.data) {
if (data.data.hasOwnProperty(objectId)) {
containersArray.push(
new ContainerVm(data.data[objectId]));
}
}
} catch (e) {
this.containersSubj.error(e);
return;
}
this.containersSubj.next(containersArray);
});
示例3: Date
"assertion=" + this.window.localStorage.getItem("refresh_token"), options).subscribe(res => {
let refreshPayload = res.json();
if (refreshPayload.access_token !== '' && refreshPayload.access_token !== undefined && refreshPayload.access_token !== null) {
this.window.localStorage.setItem("access_token", res.json().access_token);
this.window.localStorage.setItem("refresh_token", res.json().refresh_token);
let expirationDate = new Date();
expirationDate = new Date(expirationDate.getTime() + (res.json().expires_in * 1000));
this.window.localStorage.setItem("expiration_date", expirationDate.toString());
subject.next(res);
}
else {
subject.error(res);
}
}, error => { subject.error(error); });
示例4:
}, error => {
subject.error(error);
});
示例5:
error => {
if (!this.interceptError(error)) {
subject.error(error);
}
},