error handling
This commit is contained in:
16
dist/callchain.js
vendored
16
dist/callchain.js
vendored
@ -38,7 +38,12 @@ class AAsyncBaseChainItem extends AChainItem {
|
||||
}
|
||||
this.addListener('yourturn', (message) => {
|
||||
log.info(`Executing ${this.toString()}`);
|
||||
this.func(message, this.next.send);
|
||||
try {
|
||||
this.func(message, this.next.send);
|
||||
}
|
||||
catch (e) {
|
||||
log.error(`Chain interrupted: ${e}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -53,8 +58,13 @@ class ABaseChainItem extends AChainItem {
|
||||
}
|
||||
this.addListener('yourturn', (message) => {
|
||||
log.info(`Executing ${this.toString()}`);
|
||||
let result = this.func(message);
|
||||
this.next.send(result);
|
||||
try {
|
||||
let result = this.func(message);
|
||||
this.next.send(result);
|
||||
}
|
||||
catch (e) {
|
||||
log.error(`Chain interrupted: ${e}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user