mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-17 17:23:08 +02:00
fix: error handling (closes #506)
This commit is contained in:
parent
69a1eea7c7
commit
1b0b0a22f9
@ -77,7 +77,13 @@ module.exports.sendToHouston = async client => {
|
|||||||
client.log.success('Posted client stats');
|
client.log.success('Posted client stats');
|
||||||
client.log.debug(res);
|
client.log.debug(res);
|
||||||
} catch (res) {
|
} catch (res) {
|
||||||
client.log.error('An error occurred whilst posting stats:', (await res.json())?.error);
|
try {
|
||||||
|
const json = await res.json();
|
||||||
|
client.log.error('An error occurred whilst posting stats:', json);
|
||||||
|
} catch (error) {
|
||||||
|
client.log.error('An error occurred whilst posting stats and the response couldn\'t be parsed');
|
||||||
|
client.log.error(error.message);
|
||||||
|
}
|
||||||
client.log.debug(res);
|
client.log.debug(res);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user