From 4151a833a034f298287e98c3fcb285b4dbaf6cf3 Mon Sep 17 00:00:00 2001 From: Dawid Kubicki Date: Sat, 12 Jan 2019 12:41:00 +0100 Subject: [PATCH] error handling better added --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 85fd920..5443f95 100644 --- a/index.js +++ b/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(); } };