Handing promise rejections from GuildAuditLogs#build to the user (#1474)

* handing guildauditlog's promise rejections to the user

* Returning a new Promise to resolve a Promise.all is unnecessary.
Also for the docs, it returns a Promise<GuildauditLogs>, not GuildAuditLogs directly.

* totally did not removed that line
This commit is contained in:
SpaceEEC
2017-05-09 00:19:24 +02:00
committed by Crawl
parent 294f5ea5c8
commit bb0ee59718

View File

@@ -62,13 +62,11 @@ class GuildAuditLogs {
/**
* Handles possible promises for entry targets.
* @returns {GuildAuditLogs}
* @returns {Promise<GuildAuditLogs>}
*/
static build(...args) {
return new Promise(resolve => {
const logs = new GuildAuditLogs(...args);
Promise.all(logs.entries.map(e => e.target)).then(() => resolve(logs));
});
const logs = new GuildAuditLogs(...args);
return Promise.all(logs.entries.map(e => e.target)).then(() => logs);
}
/**