Skip to content

Commit

Permalink
fix: fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
ebina4yaka committed May 15, 2024
1 parent 3babb82 commit c5d051c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,17 @@ client.on('ready', async () => {
})

const errorHandler = async (queue, error) => {
winston.loggers.get('error').error(`Error event: ${error.message}`)
winston.loggers.get('error').error(`Error queue: ${util.inspect(queue)}`)
winston.loggers.get('error').error(`Error track: ${util.inspect(queue.currentTrack)}`)
queue.metadata.channel.send(
`エラーが発生しました\n**${queue.currentTrack.title}\n**${error.message}**`,
)

Sentry.withScope((scope) => {
scope.setExtra('queue', queue)
scope.setExtra('track', queue.currentTrack)
Sentry.captureException(error)
})
await Sentry.flush(2500)

winston.loggers.get('error').error(`Error event: ${error.message}`)
winston.loggers.get('error').error(`Error queue: ${util.inspect(queue)}`)
winston.loggers.get('error').error(`Error track: ${util.inspect(queue.currentTrack)}`)
queue.metadata.channel.send(`エラーが発生しました\n**${error.message}**`)
}

player.events.on('error', errorHandler)
Expand Down

0 comments on commit c5d051c

Please sign in to comment.