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

Fetching Audit Logs leads to Uncaught Promise Error if rejected #1471

Closed
ghost opened this issue May 6, 2017 · 4 comments
Closed

Fetching Audit Logs leads to Uncaught Promise Error if rejected #1471

ghost opened this issue May 6, 2017 · 4 comments

Comments

@ghost
Copy link

ghost commented May 6, 2017

Please describe the problem you are having in as much detail as possible:
Using <Guild>.fetchAuditLogs leads to an uncaught promise error, if the request is rejected by the Request Handler (like due to missing permissions).

Using following piece:

message.guild.fetchAuditLogs({ user: '200317799350927360' }).catch((err) => console.log('hydar', err))

Logs:

1|CharuruD | 2017/05/07, 00:57:05.733@ Uncaught Promise Error:
1|CharuruD | { DiscordAPIError: Missing Permissions
1|CharuruD |     at item.request.gen.end (/var/opt/Discord_Bot/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:68:65)
1|CharuruD |     at then (/var/opt/Discord_Bot/node_modules/snekfetch/src/index.js:181:21)
1|CharuruD |     at process._tickCallback (internal/process/next_tick.js:109:7)
1|CharuruD |   name: 'DiscordAPIError',
1|CharuruD |   message: 'Missing Permissions',
1|CharuruD |   code: 50013 }

Further details:

  • discord.js version: v11.1 master 07623d4
  • node.js version: v7.9.0
  • Operating system: Debian jessie
  • Priority this issue should have – please be realistic and elaborate if possible: Normal
@dragonfire535
Copy link
Contributor

You probably do not have permission to View Audit Logs.

@appellation
Copy link
Member

The issue, as reported, is that the lib is not correctly passing down the promise rejection.

@dragonfire535
Copy link
Contributor

Oh. Welp.

@iCrawl
Copy link
Member

iCrawl commented May 8, 2017

Fixed in f95f18b on master and bb0ee59 on v11.2 respectively.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants