0
私は以下のコードを持っており、ロールバックを行うために拒否が発生したときに実行を停止したい。しかし、チェーン内に不合格があっても実行を継続します。 チェーン内の拒否にもかかわらず、チェーンされた約束が実行され続ける
__cacheHandheldData(userResult.handhelduuid).then((oldhandheldId) => {
olduuid = oldhandheldId;
__cacheUserdata(userResult.userdata_id) //userResult.userdata_id
}).then((x) => {
__reconciliateToNewUserData(userResult.userdata_id, handheldData.uuid)
}).then((x) => {
__linkUser(userResult._id, handheldData.userdata_id, handheldData.uuid)
}).then((x) => {
__unlinkUser(olduuid)
}).then((x) => {
__attachMergedUserdata(userResult.handhelduuid)
}).then((x) => {
__cleanHandheld(userResult.handhelduuid)
}).then((x) => {
__cleanUserdata(userResult.userdata_id)
}).then((x) => {
__cleanHandheldCache(userResult.handhelduuid)
}).then((x) => {
__cleanUserdataCache(userResult.userdata_id)
}).then((x) => {
__removeHandHeldFromRedis(userResult.handhelduuid)
}).then((x) => {
console.log('reached to destination')
var response = {};
response.errorCode = '00';
res.setHeader('Access-Control-Allow-Origin', '*');
res.send(201, response);
return next;
}).catch((err) => {
console.log('[general]', err)
});
これら__functionsの各
は形式ですfunction __cacheHandheldData(oldhandhelduuid){
return new Promise((resolve, reject)=>{});}
個別の関数呼び出しでreturn文が見つかりませんでした。彼らは接続されていません。 – Sirko