Error and improvements added(fixed).

This commit is contained in:
alfredojl
2020-09-21 14:48:10 -05:00
parent 3b9a9492c2
commit ccbc286369
6 changed files with 30 additions and 27 deletions
+11 -2
View File
@@ -15,6 +15,7 @@ faker.locale = "es_MX";
const colors = require('colors');
const symbols = require('log-symbols');
const progress = require('cli-progress');
const Inventario = require('../server/models/tablas/Inventario');
let rows = 100;
let faileds = 0;
@@ -58,7 +59,11 @@ async function fillingEquipo() {
throw new Error();
});
await fillEquipo(noInventario, idActivoFijo)
.catch(() => {
.catch(async() => {
await Inventario.destroy({
where: noInventario
})
then(() => censo--);
console.log(symbols.warning, 'Error creating «equipo»');
barequipo.stop();
throw new Error();
@@ -102,7 +107,11 @@ async function fillingPrinters() {
throw new Error();
});
await fillPrinters(noInventario, idActivoFijo)
.catch(() => {
.catch(async() => {
await Inventario.destroy({
where: noInventario
})
.then(() => censo--);
console.log(symbols.warning, 'Error creating «printers»');
barprinters.stop();
throw new Error();