From a245d8b392cc0800ba9b6e90377ef4d7449fb5ae Mon Sep 17 00:00:00 2001 From: Oliver Boehlk Date: Fri, 29 May 2020 18:44:35 +0200 Subject: [PATCH] add more detailed error messages --- largefetch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/largefetch.js b/largefetch.js index d3f6851..8b86197 100644 --- a/largefetch.js +++ b/largefetch.js @@ -85,7 +85,7 @@ const storeFullData = async marketData => { const querystring = `INSERT INTO marketv2 (kind,price,time, quality) VALUES (${kind},${price},${storedate}, ${quality})` connection.query(querystring, function (error, results, fields) { if (error) { - tgBot.sendMessage(tgInfo.debugChat, `ERROR: fetching market - database error:\n${error}`); + tgBot.sendMessage(tgInfo.debugChat, `ERROR: inserting marketdata - database error:\n${error}\nQUERY: ${querystring}`); return connection.rollback(function () { throw error; }); @@ -102,7 +102,7 @@ const storeFullData = async marketData => { const querystring = `INSERT INTO marketcap (kind,quality,price,amount,time) VALUES (${kind},${quality},${price},${amount},${storedate})`; connection.query(querystring, function (error, results, fields) { if (error) { - tgBot.sendMessage(tgInfo.debugChat, `ERROR: fetching market - database error:\n${error}`); + tgBot.sendMessage(tgInfo.debugChat, `ERROR: inserting marketcaps - database error:\n${error}\nQUERY: ${querystring}`); return connection.rollback(function () { throw error; });