Uncaught Promise Error in Request Handler
See original GitHub issuePlease describe the problem you are having in as much detail as possible: When a Promise gets rejected due to a Discord API Error (let’s say Missing Permissions), I’m logging an Uncaught Promise Error for the error, additionally to that, my catch handler on all discord.js promises, logs the same error too.
Log:
1|CharuruD | error: 2017/07/07, 22:04:19.966@ Caught Error: { DiscordAPIError: Missing Permissions
1|CharuruD | at item.request.gen.end (/var/opt/Discord_Bot/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:69:65)
1|CharuruD | at then (/var/opt/Discord_Bot/node_modules/snekfetch/src/index.js:243:21)
1|CharuruD | at <anonymous>
1|CharuruD | at process._tickCallback (internal/process/next_tick.js:169:7)
1|CharuruD | name: 'DiscordAPIError',
1|CharuruD | message: 'Missing Permissions',
1|CharuruD | code: 50013 }
1|CharuruD | error: 2017/07/07, 22:04:19.970@ Uncaught Promise Error: DiscordAPIError: Missing Permissions
1|CharuruD | at item.request.gen.end (/var/opt/Discord_Bot/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:69:65)
1|CharuruD | at then (/var/opt/Discord_Bot/node_modules/snekfetch/src/index.js:243:21)
1|CharuruD | at <anonymous>
Include a reproducible code sample here, if possible: In my case a send method with a file upload.
message.channel.send({ files: [ botBasepath+'/assets/profile/level.png' ] }).catch(this.client.errorConsole);
Further details:
- discord.js version: v11.2 (11.1-dev branch)
- node.js version: v8.1.3
- Operating system: Debian Jessie x64
- Priority this issue should have – please be realistic and elaborate if possible: High, since leaking error.
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Error handling with promises - The Modern JavaScript Tutorial
Promise chains are great at error handling. When a promise rejects, the control jumps to the closest rejection handler.
Read more >Getting “Uncaught (in promise) Error” from within a catch block
I'm a little new to es6 async and await ; however, it seems very similar to what I'm used to in C#. Get:...
Read more >Promises - Error Handling - Beginner JavaScript - Wes Bos
What does that log "Uncaught (in promise)" mean? It means that there was an error in one of our promises, but we did...
Read more >Promise Error Handling - JavaScript Tutorial
In this tutorial, you will learn about promise error handling that shows you how to handle error in promises. ... Uncaught Error: Invalid...
Read more >Promise.prototype.then() - JavaScript - MDN Web Docs
All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Have you solved this issue?
Hm, funny thing is that it seems to be an issue before the commando PR Uncaught Commando Promise Error (https://github.com/Gawdl3y/discord.js-commando/pull/52). If I await the command promise directly, the issue is gone. I think we can close this issue.