Skip to content

Commit 60bd947

Browse files
committed
fix(health): logs error messages
1 parent f0b4f93 commit 60bd947

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

modules/health/logic/healthLogic.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
const Sentry = require('@sentry/node');
12
const ipfs = require('../../backup/logic/ipfsLogic');
23
const cache = require('../../cache/utils/cache');
34
const models = require('../../../models');
45
const aeternity = require('../../aeternity/logic/aeternity');
6+
const logger = require('../../../utils/logger')(module);
57

68
const HealthLogic = {
79
/**
@@ -17,6 +19,8 @@ const HealthLogic = {
1719
.map(async key => models[key].findOne({ raw: true })));
1820
return true;
1921
} catch (e) {
22+
logger.error(`DB health failed with: ${e.message}`);
23+
Sentry.captureException(e);
2024
return false;
2125
}
2226
},
@@ -26,6 +30,8 @@ const HealthLogic = {
2630
await ipfs.getCoreVitals();
2731
return true;
2832
} catch (e) {
33+
logger.error(`IPFS health failed with: ${e.message}`);
34+
Sentry.captureException(e);
2935
return false;
3036
}
3137
},
@@ -35,6 +41,8 @@ const HealthLogic = {
3541
await cache.getOrSet(['redisTest'], async () => 'done');
3642
return true;
3743
} catch (e) {
44+
logger.error(`Redis health failed with: ${e.message}`);
45+
Sentry.captureException(e);
3846
return false;
3947
}
4048
},
@@ -44,6 +52,8 @@ const HealthLogic = {
4452
const balance = await aeternity.getBalance();
4553
return parseInt(balance, 10) > 0;
4654
} catch (e) {
55+
logger.error(`AE health failed with: ${e.message}`);
56+
Sentry.captureException(e);
4757
return false;
4858
}
4959
},

0 commit comments

Comments
 (0)