提交 b81d708d 编写于 作者: X xuzhihao

Feature: fix err code of commonEvent

Signed-off-by: Nxuzhihao <xuzhihao16@huawei.com>
上级 4d775faa
...@@ -299,11 +299,12 @@ function subscribeCB(err, data) { ...@@ -299,11 +299,12 @@ function subscribeCB(err, data) {
} }
// 创建订阅者回调 // 创建订阅者回调
function createCB(err, subscriber) { function createCB(err, commonEventSubscriber) {
if (err.code) { if (err.code) {
console.error(`createSubscriber failed, code is ${err.code}`); console.error(`createSubscriber failed, code is ${err.code}`);
} else { } else {
console.info("createSubscriber"); console.info("createSubscriber");
subscriber = commonEventSubscriber;
// 订阅公共事件 // 订阅公共事件
CommonEvent.subscribe(subscriber, subscribeCB); CommonEvent.subscribe(subscriber, subscribeCB);
} }
......
...@@ -335,9 +335,10 @@ function SubscribeCB(err, data) { ...@@ -335,9 +335,10 @@ function SubscribeCB(err, data) {
} }
//创建订阅者回调 //创建订阅者回调
function createCB(err, subscriber) { function createCB(err, commonEventSubscriber) {
if(!err) { if(!err) {
console.info("createSubscriber"); console.info("createSubscriber");
subscriber = commonEventSubscriber;
//订阅公共事件 //订阅公共事件
try { try {
CommonEventManager.subscribe(subscriber, SubscribeCB); CommonEventManager.subscribe(subscriber, SubscribeCB);
...@@ -391,11 +392,12 @@ function subscribeCB(err, data) { ...@@ -391,11 +392,12 @@ function subscribeCB(err, data) {
} }
} }
//创建订阅者回调 //创建订阅者回调
function createCB(err, subscriber) { function createCB(err, commonEventSubscriber) {
if (err) { if (err) {
console.error(`createSubscriber failed, code is ${err.code}, message is ${err.message}`); console.error(`createSubscriber failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("createSubscriber"); console.info("createSubscriber");
subscriber = commonEventSubscriber;
//订阅公共事件 //订阅公共事件
try { try {
CommonEventManager.subscribe(subscriber, subscribeCB); CommonEventManager.subscribe(subscriber, subscribeCB);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册