(interaction, error, context = {})
| 313 | } |
| 314 | |
| 315 | export async function handleInteractionError(interaction, error, context = {}) { |
| 316 | const errorType = categorizeError(error); |
| 317 | const userMessage = getUserMessage(error, context); |
| 318 | const { logData, traceId } = buildErrorLogData(interaction, error, errorType, context); |
| 319 | |
| 320 | logInteractionError(error, errorType, logData); |
| 321 | |
| 322 | const embed = buildUserErrorEmbed(errorType, userMessage); |
| 323 | await sendErrorResponse(interaction, embed, { ...context, traceId }); |
| 324 | } |
| 325 | |
| 326 | export function withErrorHandling(fn, context = {}) { |
| 327 | return async (...args) => { |
no test coverage detected