mirror of
https://github.com/stronk-dev/RandomChad.git
synced 2026-04-20 16:45:10 +02:00
🐛 explicit discord logging of errors
This commit is contained in:
parent
ddd33d4851
commit
a441a2130b
@ -24,7 +24,8 @@ exports.notifyDiscordWebhook = async function( username, content, avatar_url, im
|
||||
}
|
||||
|
||||
// Make webhook request
|
||||
await fetch( discord.webhookurl, options )
|
||||
const data = await fetch( discord.webhookurl, options ).then( res => res.json() )
|
||||
if( data.code ) throw new Error ( `Discord webhook failed with ${ data.code }: ${ data.message }` )
|
||||
|
||||
} catch( e ) {
|
||||
console.error( 'Discord error ', e )
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user