Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling gaps [BUG] #14

Closed
AdamT20054 opened this issue Oct 22, 2022 · 3 comments
Closed

Error handling gaps [BUG] #14

AdamT20054 opened this issue Oct 22, 2022 · 3 comments
Assignees
Labels
bug Something isn't working Stale

Comments

@AdamT20054
Copy link
Owner

Describe the bug
The bot crashes when it tries to delete messages that dont exist

To Reproduce
Steps to reproduce the behavior:
Delete a message the bot was going to delete and it'll crash

Expected behavior
It shouldn't crash

Screenshots

C:\Users\Elijah\Desktop\bots\vf\node_modules@discordjs\rest\dist\index.js:659
        throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
              ^

DiscordAPIError[10008]: Unknown Message
    at SequentialHandler.runRequest (C:\Users\Elijah\Desktop\bots\vf\node_modules@discordjs\rest\dist\index.js:659:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (C:\Users\Elijah\Desktop\bots\vf\node_modules@discordjs\rest\dist\index.js:458:14)
    at async REST.request (C:\Users\Elijah\Desktop\bots\vf\node_modules@discordjs\rest\dist\index.js:902:22)
    at async MessageManager.delete (C:\Users\Elijah\Desktop\bots\vf\node_modules\discord.js\src\managers\MessageManager.js:254:5)
    at async Message.delete (C:\Users\Elijah\Desktop\bots\vf\node_modules\discord.js\src\structures\Message.js:765:5)
    at async C:\Users\Elijah\Desktop\bots\vf\node_modules\djscaptcha\src\index.cjs:328:25
    at async handleAttempt (C:\Users\Elijah\Desktop\bots\vf\node_modules\djscaptcha\src\index.cjs:311:17)
    at async C:\Users\Elijah\Desktop\bots\vf\node_modules\djscaptcha\src\index.cjs:511:13
    at async Captcha.present (C:\Users\Elijah\Desktop\bots\vf\node_modules\djscaptcha\src\index.cjs:258:9) {
  requestBody: { files: undefined, json: undefined },
  rawError: { message: 'Unknown Message', code: 10008 },
  code: 10008,
  status: 404,
  method: 'DELETE',
  url: 'https://discord.com/api/v10/channels/1033239641387716658/messages/1033524618738282496'
}

Additional context
Add error handling throughout

@AdamT20054 AdamT20054 added the bug Something isn't working label Oct 22, 2022
@AdamT20054 AdamT20054 self-assigned this Oct 22, 2022
@AdamT20054 AdamT20054 pinned this issue Oct 23, 2022
@AdamT20054 AdamT20054 moved this to In Progress in DJSCaptcha Oct 23, 2022
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions github-actions bot added the Stale label Jan 24, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in DJSCaptcha Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
Status: Done
Development

No branches or pull requests

1 participant