From 11a8ab8f98ce1053f36f5b2b33e7c568d34a1bc1 Mon Sep 17 00:00:00 2001 From: chuan6 Date: Mon, 29 Jul 2019 18:07:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(Net/persist):=20=E7=BA=A0=E6=AD=A3=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=A4=84=E7=90=86=E6=96=B9=E5=BC=8F=EF=BC=8C=E6=8B=BF?= =?UTF-8?q?=E6=8E=89=20err=20=E6=98=AF=20Observable=20=E7=9A=84=E5=81=87?= =?UTF-8?q?=E8=AE=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...err 是 Observable 的合理可能只存在于有地方抛错时抛的是 Observable 的情况;这不符合正常操作习惯。 --- src/Net/Net.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Net/Net.ts b/src/Net/Net.ts index 3f7dfc592..f81bb649b 100644 --- a/src/Net/Net.ts +++ b/src/Net/Net.ts @@ -305,9 +305,9 @@ export class Net { this.persistedDataBuffer.length = 0 return Observable.from(asyncQueue).concatAll().do({ - error: async (err: Observable) => { - const errObj = await err.toPromise() - SDKLogger.error(errObj.message) + error: (err) => { + const errmsg = err && err.message || String(err) + SDKLogger.error(errmsg) } }) }