refactor(createThermograph): endpoint rollsback only if transaction was created in it
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2021-09-07 10:30:53 +02:00
parent c4e51146fd
commit 8bdb02c0fc
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ module.exports = Self => {
return travelThermograph;
} catch (err) {
await tx.rollback();
if (tx) await tx.rollback();
throw err;
}
};