Adding missing error cause messages.

This commit is contained in:
softsimon 2020-10-28 11:00:48 +07:00
parent 29ff029b07
commit 5feaff130f
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
8 changed files with 14 additions and 13 deletions

View File

@ -26,7 +26,7 @@ class BackendInfo {
try {
this.gitCommitHash = fs.readFileSync('../.git/refs/heads/master').toString().trim();
} catch (e) {
logger.err('Could not load git commit info, skipping.');
logger.err('Could not load git commit info: ' + e.message || e);
}
}
}

View File

@ -160,7 +160,7 @@ class Bisq {
this.buildIndex();
this.calculateStats();
} catch (e) {
logger.err('loadBisqDumpFile() error.' + e.message);
logger.err('loadBisqDumpFile() error.' + e.message || e);
}
}

View File

@ -98,7 +98,7 @@ class Bisq {
logger.debug('Bisq market data updated in ' + time + ' ms');
}
} catch (e) {
logger.err('loadBisqMarketDataDumpFile() error.' + e.message);
logger.err('loadBisqMarketDataDumpFile() error.' + e.message || e);
}
}

View File

@ -41,7 +41,7 @@ class DiskCache {
}));
logger.debug('Mempool and blocks data saved to disk cache');
} catch (e) {
logger.warn('Error writing to cache file asynchronously');
logger.warn('Error writing to cache file asynchronously: ' + e.message || e);
}
}

View File

@ -110,7 +110,7 @@ class Donations {
connection.release();
return rows;
} catch (e) {
logger.err('$getDonationsFromDatabase() error' + e);
logger.err('$getDonationsFromDatabase() error: ' + e.message || e);
return [];
}
}
@ -123,7 +123,7 @@ class Donations {
connection.release();
return rows;
} catch (e) {
logger.err('$getLegacyDonations() error' + e);
logger.err('$getLegacyDonations() error' + e.message || e);
return [];
}
}
@ -159,7 +159,7 @@ class Donations {
const [result]: any = await connection.query(query, params);
connection.release();
} catch (e) {
logger.err('$addDonationToDatabase() error' + e);
logger.err('$addDonationToDatabase() error' + e.message || e);
}
}
@ -177,7 +177,7 @@ class Donations {
const [result]: any = await connection.query(query, params);
connection.release();
} catch (e) {
logger.err('$updateDonation() error' + e);
logger.err('$updateDonation() error' + e.message || e);
}
}

View File

@ -234,7 +234,7 @@ class Statistics {
connection.release();
return result.insertId;
} catch (e) {
logger.err('$create() error' + e);
logger.err('$create() error' + e.message || e);
}
}
@ -292,7 +292,7 @@ class Statistics {
return this.mapStatisticToOptimizedStatistic([rows[0]])[0];
}
} catch (e) {
logger.err('$list2H() error' + e);
logger.err('$list2H() error' + e.message || e);
}
}
@ -304,7 +304,7 @@ class Statistics {
connection.release();
return this.mapStatisticToOptimizedStatistic(rows);
} catch (e) {
logger.err('$list2H() error' + e);
logger.err('$list2H() error' + e.message || e);
return [];
}
}
@ -317,6 +317,7 @@ class Statistics {
connection.release();
return this.mapStatisticToOptimizedStatistic(rows);
} catch (e) {
logger.err('$list24h() error' + e.message || e);
return [];
}
}

View File

@ -107,7 +107,7 @@ class WebsocketHandler {
client.send(JSON.stringify(response));
}
} catch (e) {
logger.err('Error parsing websocket message: ' + e);
logger.err('Error parsing websocket message: ' + e.message || e);
}
});
});

View File

@ -20,7 +20,7 @@ export async function checkDbConnection() {
logger.info('Database connection established.');
connection.release();
} catch (e) {
logger.err('Could not connect to database.');
logger.err('Could not connect to database: ' + e.message || e);
process.exit(1);
}
}