This commit is contained in:
2023-02-21 19:01:02 +07:00
parent 16fbfdcae1
commit 2249bbbbaf
@@ -1,3 +1,5 @@
const winston = require('../../helpers/winston.logger');
const knex = require('../../../infrastructure/database/knex');
// CHECK CARD NUMBER
@@ -379,7 +381,12 @@ const insertLoadingBalance = async (
});
})
.then(trx.commit)
.catch(trx.rollback);
.catch((err) => {
winston.logger.warn(
`${uniqueCode} ERRORRRRRRR ROLLBACK ${JSON.stringify(err.message)}`
);
trx.rollback;
});
})
.then((result) => {
// console.log(result);
@@ -387,6 +394,9 @@ const insertLoadingBalance = async (
})
.catch((error) => {
console.log(error.message);
winston.logger.warn(
`${uniqueCode} ERRORRRRRRR CATCH ${JSON.stringify(err.message)}`
);
return error.message;
});
};