Skip to content

Commit c74b4f3

Browse files
committed
error handling
1 parent 545e60f commit c74b4f3

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

tooling/sparta/packages/discord/src/slashCommands/operators/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ export default {
8585
return;
8686
} catch (error) {
8787
logger.error("Failed to execute operator command:", error);
88-
await interaction.editReply({
89-
content: "Something went wrong while executing the command.",
90-
});
9188
return; // Keep explicit return
9289
}
9390
},

tooling/sparta/packages/discord/src/slashCommands/operators/register.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ export async function showRegistrationHelp(
7171
export async function registerValidator(
7272
interaction: ChatInputCommandInteraction
7373
): Promise<string> {
74-
try {
75-
await interaction.deferReply({
76-
flags: MessageFlags.Ephemeral,
77-
});
74+
await interaction.deferReply({
75+
flags: MessageFlags.Ephemeral,
76+
});
7877

78+
try {
7979
// Get parameters from the command options
8080
const address = interaction.options.getString("address");
8181
const blockNumber = interaction.options.getString("block-number");
@@ -333,10 +333,9 @@ export async function registerValidator(
333333
"Something went wrong while processing your registration.",
334334
});
335335
} else {
336-
await interaction.reply({
336+
await interaction.editReply({
337337
content:
338338
"Something went wrong while processing your registration.",
339-
ephemeral: true,
340339
});
341340
}
342341

0 commit comments

Comments
 (0)