INNER CODE UNIT · JavaScript
process
yangfeng20/boss_batch_push · src/oop-self-req-main.js:1266
let process = Array.from(jobList).reduce((promiseChain, jobTag) => {
let jobTitle = BossDOMApi.getJobTitle(jobTag);
return promiseChain
.then(() => this.matchJobPromise(jobTag))
.then(() => this.reqJobDetail(jobTag, 2, false))
.then(jobCardJson => this.jobDetailFilter(jobTag, jobCardJson))
.then(() => this.sendPublishReq(jobTag))
.then(publishResult => this.handlerPublishResult(jobTag, publishResult, publishResultCount))
.catch(error => {
// 在catch中return是结束当前元素,不会结束整个promiseChain;
// 需要结束整个promiseChain,在catch throw exp,但还会继续执行下一个元素catch中的逻辑
switch (true) {
case error instanceof JobNotMatchExp:
this.operationPanel.refreshShow(jobTitle + " 不满足投递条件")
++notMatchCount;
break;
case error instanceof FetchJobDetailFailExp: