Promise rejection wording change

merge-requests/1/merge
Bsian 2019-10-29 16:25:41 +00:00
parent cd187b21f9
commit 72764f7e14
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 1 additions and 1 deletions

View File

@ -158,7 +158,7 @@ export default class Util {
public async createModerationLog(user: string, moderator: Member, type: number, reason?: string, duration?: number): Promise<ModerationInterface> { public async createModerationLog(user: string, moderator: Member, type: number, reason?: string, duration?: number): Promise<ModerationInterface> {
const moderatorID = moderator.id; const moderatorID = moderator.id;
const account = await this.client.db.Account.findOne({ $or: [{ username: user }, { userID: user }] }); const account = await this.client.db.Account.findOne({ $or: [{ username: user }, { userID: user }] });
if (!account) return Promise.reject(new Error('Account not found')); if (!account) return Promise.reject(new Error(`Account ${user} not found`));
const { username, userID } = account; const { username, userID } = account;
const logInput: { username: string, userID: string, logID: string, moderatorID: string, reason?: string, type: number, date: Date, expiration?: { date: Date, processed: boolean }} = { const logInput: { username: string, userID: string, logID: string, moderatorID: string, reason?: string, type: number, date: Date, expiration?: { date: Date, processed: boolean }} = {
username, userID, logID: uuid(), moderatorID, type, date: new Date(), username, userID, logID: uuid(), moderatorID, type, date: new Date(),