Bläddra i källkod

Beningn Failures

pull/9/head
guest 2 år sedan
förälder
incheckning
ebfa0b2fc0
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4
    1
      index.js

+ 4
- 1
index.js Visa fil

// if(e){ // if(e){
if(Promise.resolve(e) === e) return e; if(Promise.resolve(e) === e) return e;
// console.error(e) // console.error(e)
e.benign = true;
throw e; // Not a hard error but we need this for bcontinueonfailure as we still want to stop on firstsuccess. throw e; // Not a hard error but we need this for bcontinueonfailure as we still want to stop on firstsuccess.
// } // }
}) })
// if(e){ // if(e){
if(Promise.resolve(e) === e) return e; if(Promise.resolve(e) === e) return e;
// console.error(e) // console.error(e)
e.benign = true;
throw e; // Not a hard error but we need this for bcontinueonfailure throw e; // Not a hard error but we need this for bcontinueonfailure
// } // }
}) })
return hasElxr(p).then((value)=>{ return hasElxr(p).then((value)=>{
if(value) return p if(value) return p
// PB : TODO -- Using throw like this is not friendly with any... // PB : TODO -- Using throw like this is not friendly with any...
throw { value : false };
throw Object.assign( new Error('Benign Failure in Batch')
, { value : false, benign : true });
}) })
} }
})(pp) })(pp)

Laddar…
Avbryt
Spara