已合并
fix: add error logs to getRegisterId/isPushStopped catch blocks #58
fix: add error logs to getRegisterId/isPushStopped catch blocks #58
已合并
zeming创建于 9月5日
共 1 个文件变更+4-2
@@ -100,7 +100,8 @@ export class RNJPushTurboModule extends TurboModule implements TM.JPushModule.Sp
100 public getRegisterId(callback: (res: RegisterResult) => void) {100 public getRegisterId(callback: (res: RegisterResult) => void) {
101 JPushInterface.getRegistrationId().then((rid: string) => {101 JPushInterface.getRegistrationId().then((rid: string) => {
102 callback({ "registerID": rid });102 callback({ "registerID": rid });
103- }).catch(() => {103+ }).catch((err: BusinessError) => {
104+ Logger.error(`###JPush getRegistrationId fail: ${JSON.stringify(err)}`);
104 callback({ "registerID": "" });105 callback({ "registerID": "" });
105 });106 });
106 };107 };
@@ -261,7 +262,8 @@ export class RNJPushTurboModule extends TurboModule implements TM.JPushModule.Sp
261 public isPushStopped(callBack: (bo: boolean) => void) {262 public isPushStopped(callBack: (bo: boolean) => void) {
262 JPushInterface.isPushStopped().then((bo: boolean | undefined) => {263 JPushInterface.isPushStopped().then((bo: boolean | undefined) => {
263 callBack(bo || false);264 callBack(bo || false);
264- }).catch(() => {265+ }).catch((err: BusinessError) => {
266+ Logger.error(`###JPush isPushStopped fail: ${JSON.stringify(err)}`);
265 callBack(false);267 callBack(false);
266 });268 });
267 }269 }