We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 69a1eea commit 1b0b0a2Copy full SHA for 1b0b0a2
src/lib/stats.js
@@ -77,7 +77,13 @@ module.exports.sendToHouston = async client => {
77
client.log.success('Posted client stats');
78
client.log.debug(res);
79
} catch (res) {
80
- client.log.error('An error occurred whilst posting stats:', (await res.json())?.error);
+ try {
81
+ const json = await res.json();
82
+ client.log.error('An error occurred whilst posting stats:', json);
83
+ } catch (error) {
84
+ client.log.error('An error occurred whilst posting stats and the response couldn\'t be parsed');
85
+ client.log.error(error.message);
86
+ }
87
88
}
89
};
0 commit comments