add more detailed error messages
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user