mirror of
https://github.com/pockethost/pockethost.git
synced 2025-06-07 22:56:39 +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 }) => {
|
export const discordAlert = (message: { toString: () => string }) => {
|
||||||
const url = DISCORD_ALERT_CHANNEL_URL()
|
const url = DISCORD_ALERT_CHANNEL_URL()
|
||||||
if (!url) return
|
if (!url) return
|
||||||
const m = message.toString()
|
const m = `${message}${message instanceof Error ? `\n${message.stack}` : ''}`
|
||||||
const isCached = !!cache[m]
|
const isCached = !!cache[m]
|
||||||
if (isCached) {
|
if (isCached) {
|
||||||
clearTimeout(cache[m])
|
clearTimeout(cache[m])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user