MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / logInteractionError

Function logInteractionError

src/utils/errorHandler.js:185–204  ·  view source on GitHub ↗
(error, errorType, logData)

Source from the content-addressed store, hash-verified

183}
184
185function logInteractionError(error, errorType, logData) {
186 const isUserError = [
187 ErrorTypes.VALIDATION,
188 ErrorTypes.RATE_LIMIT,
189 ErrorTypes.USER_INPUT,
190 ErrorTypes.PERMISSION
191 ].includes(errorType);
192 const isExpectedError = Boolean(error?.context?.expected === true || error?.context?.suppressErrorLog === true);
193
194 if (isUserError || isExpectedError) {
195 if (errorType !== ErrorTypes.RATE_LIMIT) {
196 logger.debug(`User Error [${errorType.toUpperCase()}]: ${error.message}`, logData);
197 }
198 } else {
199 logger.error(`System Error [${errorType.toUpperCase()}]`, {
200 ...logData,
201 stack: error.stack
202 });
203 }
204}
205
206async function sendErrorResponse(interaction, embed, context = {}) {
207 try {

Callers 2

replyUserErrorFunction · 0.85
handleInteractionErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected