mirror of
https://github.com/Burn-E99/GroupUp.git
synced 2026-06-04 00:43:49 -04:00
Add error handling to event creation
This commit is contained in:
@@ -4,6 +4,7 @@ import { eventDateId, eventDescriptionId, eventTimeId, eventTimeZoneId } from '.
|
|||||||
import { addTokenToMap, createLFGPost, getFinalActivity, idSeparator, pathIdxSeparator } from './utils.ts';
|
import { addTokenToMap, createLFGPost, getFinalActivity, idSeparator, pathIdxSeparator } from './utils.ts';
|
||||||
import { Activities, Activity } from './activities.ts';
|
import { Activities, Activity } from './activities.ts';
|
||||||
import { getDateFromRawInput } from './dateTimeUtils.ts';
|
import { getDateFromRawInput } from './dateTimeUtils.ts';
|
||||||
|
import utils from '../../utils.ts';
|
||||||
|
|
||||||
export const customId = 'finalize';
|
export const customId = 'finalize';
|
||||||
|
|
||||||
@@ -73,7 +74,7 @@ const execute = async (bot: Bot, interaction: Interaction) => {
|
|||||||
customIdIdxPath,
|
customIdIdxPath,
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
);
|
).catch((e: Error) => utils.commonLoggers.interactionSendError('step2-finalize.ts', interaction, e));
|
||||||
} else {
|
} else {
|
||||||
somethingWentWrong(bot, interaction, 'noDataFromEventDescriptionModal');
|
somethingWentWrong(bot, interaction, 'noDataFromEventDescriptionModal');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ const execute = async (bot: Bot, interaction: Interaction) => {
|
|||||||
// Let discord know we didn't ignore the user
|
// Let discord know we didn't ignore the user
|
||||||
bot.helpers.sendInteractionResponse(interaction.id, interaction.token, {
|
bot.helpers.sendInteractionResponse(interaction.id, interaction.token, {
|
||||||
type: InteractionResponseTypes.DeferredUpdateMessage,
|
type: InteractionResponseTypes.DeferredUpdateMessage,
|
||||||
});
|
}).catch((e: Error) => utils.commonLoggers.interactionSendError('step3-createEvent.ts', interaction, e));
|
||||||
} else {
|
} else {
|
||||||
somethingWentWrong(bot, interaction, 'noDataFromFinalizeEventStep');
|
somethingWentWrong(bot, interaction, 'noDataFromFinalizeEventStep');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user