refs #6915 master into test #2092
|
@ -86,7 +86,13 @@ module.exports = Self => {
|
|||
const getLabelResponse = await sendXmlDoc('getLabel', {mrw, shipmentId}, 'text/xml');
|
||||
const file = getTextByTag(getLabelResponse, 'EtiquetaFile');
|
||||
|
||||
await models.Expedition.updateAll({id: expeditionFk}, {externalId: shipmentId}, myOptions);
|
||||
try {
|
||||
await models.Expedition.updateAll({id: expeditionFk}, {externalId: shipmentId}, myOptions);
|
||||
await myOptions.transaction.commit();
|
||||
} catch (error) {
|
||||
await myOptions.transaction.rollback();
|
||||
throw new UserError(`Cant update the expedition`);
|
||||
}
|
||||
return file;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue