mirror of
https://github.com/pockethost/pockethost.git
synced 2025-06-05 13:46:40 +00:00
enh: discord error reporting
This commit is contained in:
parent
430495387f
commit
dbfc49e4b5
@ -6,7 +6,7 @@ const cache: { [_: string]: NodeJS.Timeout } = {}
|
||||
export const discordAlert = (message: { toString: () => string }) => {
|
||||
const url = DISCORD_ALERT_CHANNEL_URL()
|
||||
if (!url) return
|
||||
const m = message.toString()
|
||||
const m = `${message}${message instanceof Error ? `\n${message.stack}` : ''}`
|
||||
const isCached = !!cache[m]
|
||||
if (isCached) {
|
||||
clearTimeout(cache[m])
|
||||
|
Loading…
x
Reference in New Issue
Block a user