error handling better added
This commit is contained in:
parent
ffb64f77e6
commit
4151a833a0
6
index.js
6
index.js
@ -23,11 +23,15 @@ const save_data = async ip => {
|
||||
});
|
||||
await item.save();
|
||||
} catch (error) {
|
||||
console.log("ERROR z CATCHA => " + error);
|
||||
const item = new dbSchema({
|
||||
ip,
|
||||
status: "Urządzenie przestało działać - prawdopodobnie brak zasilania"
|
||||
});
|
||||
await item.save();
|
||||
item
|
||||
.save()
|
||||
.then()
|
||||
.catch();
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user