refactor: update command tests to use require syntax and improve error handling
Deploy to NAS / deploy (push) Successful in 1m4s

This commit is contained in:
2025-12-25 10:28:44 -05:00
parent b362a43886
commit 06ac40a6d7
7 changed files with 33 additions and 25 deletions
+3 -3
View File
@@ -34,7 +34,7 @@ export default class Command {
this._logger.info(`Executing command: ${interaction.commandName}`);
await this.run(interaction);
} catch (error) {
this.handleError(interaction, error);
await this.handleError(interaction, error);
}
}
@@ -44,13 +44,13 @@ export default class Command {
}
// Standardized error handling
handleError(interaction, error) {
async handleError(interaction, error) {
this._logger.error(`Command ${interaction.commandName} failed:`, error);
const response = interaction.deferred ? 'followUp' : 'reply';
const errorMessage = this.getErrorMessage(error);
interaction[response]({
await interaction[response]({
content: errorMessage,
ephemeral: true,
});