Add error handling to event creation

This commit is contained in:
Ean Milligan (Bastion) 2023-04-07 00:15:10 -04:00
parent 3ff04ec8d7
commit 5ccf65d89b
2 changed files with 3 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import { eventDateId, eventDescriptionId, eventTimeId, eventTimeZoneId } from '.
import { addTokenToMap, createLFGPost, getFinalActivity, idSeparator, pathIdxSeparator } from './utils.ts';
import { Activities, Activity } from './activities.ts';
import { getDateFromRawInput } from './dateTimeUtils.ts';
import utils from '../../utils.ts';
export const customId = 'finalize';
@ -73,7 +74,7 @@ const execute = async (bot: Bot, interaction: Interaction) => {
customIdIdxPath,
true,
),
);
).catch((e: Error) => utils.commonLoggers.interactionSendError('step2-finalize.ts', interaction, e));
} else {
somethingWentWrong(bot, interaction, 'noDataFromEventDescriptionModal');
}

View File

@ -46,7 +46,7 @@ const execute = async (bot: Bot, interaction: Interaction) => {
// Let discord know we didn't ignore the user
bot.helpers.sendInteractionResponse(interaction.id, interaction.token, {
type: InteractionResponseTypes.DeferredUpdateMessage,
});
}).catch((e: Error) => utils.commonLoggers.interactionSendError('step3-createEvent.ts', interaction, e));
} else {
somethingWentWrong(bot, interaction, 'noDataFromFinalizeEventStep');
}