global codestyle refactoring: err -> e

This commit is contained in:
Mestima 2023-03-30 04:55:35 +03:00
parent 874ad26c03
commit cd26624454
5 changed files with 24 additions and 24 deletions

View File

@ -5,8 +5,8 @@ const cat = async () => {
.then((res) => {
return res.data.file;
})
.catch((err) => {
console.log(err);
.catch((e) => {
console.log(e);
});
};

View File

@ -5,8 +5,8 @@ const fox = async () => {
.then((res) => {
return res.data.image;
})
.catch((err) => {
console.log(err);
.catch((e) => {
console.log(e);
});
};

View File

@ -21,8 +21,8 @@ const InteractionHandler = class {
});
}
return this;
} catch(err) {
throw err;
} catch(e) {
throw e;
}
}
@ -41,8 +41,8 @@ const InteractionHandler = class {
.then(() => {
console.log(`${chalk.green('Done:')} all commands are registered at the dev guild`);
})
.catch((err) => {
console.log(`${chalk.red('Error:')} ${err}`);
.catch((e) => {
console.log(`${chalk.red('Error:')} ${e}`);
});
}
@ -53,8 +53,8 @@ const InteractionHandler = class {
.then(() => {
console.log(`${chalk.green('Done:')} all commands are unregistered at the dev guild`);
})
.catch((err) => {
console.log(`${chalk.red('Error:')} ${err}`);
.catch((e) => {
console.log(`${chalk.red('Error:')} ${e}`);
});
}
@ -63,8 +63,8 @@ const InteractionHandler = class {
.then(() => {
console.log(`${chalk.green('Done:')} command '${commandId}' has been unregistered at the dev guild`);
})
.catch((err) => {
console.log(`${chalk.red('Error:')} ${err}`);
.catch((e) => {
console.log(`${chalk.red('Error:')} ${e}`);
});
}
@ -75,8 +75,8 @@ const InteractionHandler = class {
.then(() => {
console.log(`${chalk.green('Done:')} all commands are registered globally`);
})
.catch((err) => {
console.log(`${chalk.red('Error:')} ${err}`);
.catch((e) => {
console.log(`${chalk.red('Error:')} ${e}`);
});
}
@ -87,8 +87,8 @@ const InteractionHandler = class {
.then(() => {
console.log(`${chalk.green('Done:')} all commands are unregistered globally`);
})
.catch((err) => {
console.log(`${chalk.red('Error:')} ${err}`);
.catch((e) => {
console.log(`${chalk.red('Error:')} ${e}`);
});
}
@ -97,8 +97,8 @@ const InteractionHandler = class {
.then(() => {
console.log(`${chalk.green('Done:')} command '${commandId}' has been unregistered globally`);
})
.catch((err) => {
console.log(`${chalk.red('Error:')} ${err}`);
.catch((e) => {
console.log(`${chalk.red('Error:')} ${e}`);
});
}
};

View File

@ -30,8 +30,8 @@ const PresenceHandler = class {
await client.user.setPresence(presencePayload);
return { status: this.status, content: this.content, type: type };
} catch (err) {
throw err;
} catch (e) {
throw e;
}
}
};

View File

@ -20,9 +20,9 @@ const LunaInteractionHandler = await new InteractionHandler().init(TOKEN)
console.log(`${chalk.green('Done:')} InteractionHandler initialized successfully`)
return handler;
})
.catch((err) => {
.catch((e) => {
console.log(`${chalk.red('Error:')} can not initialize InteractionHandler`)
throw err;
throw e;
});
const LunaAPIService = await new APIService().init();
@ -99,9 +99,9 @@ Luna.on(Discord.Events.ClientReady, async () => {
.then((res) => {
console.log(`${chalk.green('Done:')} PresenceHandler initialized successfully | status: ${res.status} | type: ${res.type} | content: ${res.content}`);
})
.catch((err) => {
.catch((e) => {
console.log(`${chalk.red('Error:')} can not initialize PresenceHandler`);
throw err;
throw e;
});
await LunaInteractionHandler.registerCommandsDev(CLIENT_ID, DEV_GUILD_ID);
});