{"record":{"id":"d59709282b4b55c4","repo":"SillyTavern/SillyTavern","slug":"error-running-quick-reply-name-error-messa","errorCode":null,"errorMessage":"Error running Quick Reply \"${name}\": ${error.message}","messagePattern":"Error running Quick Reply \"(.+?)\": (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"public/scripts/slash-commands.js","lineNumber":4262,"sourceCode":"        });\n        const result = await closure.execute();\n        return result.pipe;\n    }\n\n    if (typeof globalThis.executeQuickReplyByName !== 'function') {\n        throw new Error(t`Quick Reply extension is not loaded`);\n    }\n\n    try {\n        name = name.trim();\n        /**@type {ExecuteSlashCommandsOptions} */\n        const options = {\n            abortController: args._abortController,\n            debugController: args._debugController,\n        };\n        return await globalThis.executeQuickReplyByName(name, args, options);\n    } catch (error) {\n        throw new Error(t`Error running Quick Reply \"${name}\": ${error.message}`);\n    }\n}\n\n/**\n *\n * @param {import('./slash-commands/SlashCommand.js').NamedArguments} param0\n * @param {string} [reason]\n */\nfunction abortCallback({ _abortController, quiet }, reason) {\n    if (quiet instanceof SlashCommandClosure) throw new Error(t`argument 'quiet' cannot be a closure for command /abort`);\n    _abortController.abort((reason ?? '').toString().length == 0 ? t`/abort command executed` : reason, !isFalseBoolean(quiet?.toString() ?? 'true'));\n    return '';\n}\n\nasync function delayCallback(_, amount) {\n    if (!amount) {\n        console.warn('WARN: No amount provided for /delay command');\n        return '';","sourceCodeStart":4244,"sourceCodeEnd":4280,"githubUrl":"https://github.com/SillyTavern/SillyTavern/blob/8172dcd0ee672d3cd9a5e5f7af134f91a45cd2b8/public/scripts/slash-commands.js#L4244-L4280","documentation":"A wrapper error thrown after globalThis.executeQuickReplyByName rejects. The original error from the Quick Reply execution is captured in a try/catch and re-thrown with the Quick Reply's name and the underlying message. It surfaces any failure inside the matched Quick Reply's own slash-command script.","triggerScenarios":"A Quick Reply whose slash-command body throws (bad macro, undefined command, syntax error in a closure), or whose referenced script/preset is missing. The name passed must be an existing Quick Reply label; the inner error is whatever that Quick Reply produced.","commonSituations":"Editing a Quick Reply and introducing a typo in a /command; a Quick Reply that references a variable not defined in the current chat; a Quick Reply whose underlying script relies on another extension that is now disabled.","solutions":["Read the embedded error.message: it is the real cause from inside the Quick Reply.","Open the Quick Reply in Extensions > Quick Reply and run its slash-command body directly in the console to reproduce.","Fix the underlying command/macro/variable reference inside the Quick Reply definition.","Wrap the call in a try/catch to degrade gracefully if the Quick Reply is best-effort."],"exampleFix":"// before\nreturn await globalThis.executeQuickReplyByName('MyQR', args, options);\n\n// after\ntry {\n    return await globalThis.executeQuickReplyByName('MyQR', args, options);\n} catch (e) {\n    console.error(`MyQR failed: ${e.message}`);\n    return '';\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    return await globalThis.executeQuickReplyByName(name, args, options);\n} catch (e) {\n    console.error(`Quick Reply '${name}' failed: ${e.message}`);\n    return '';\n}","preventionTips":["Test Quick Reply bodies standalone before wiring them into callables.","Keep QR scripts self-contained (avoid undeclared variables).","Wrap QR calls in try/catch when their failure is non-fatal."],"tags":["slash-commands","quick-reply","wrapper","runtime"],"backgroundTag":null,"analyzedSha":"8172dcd0ee672d3cd9a5e5f7af134f91a45cd2b8","analyzedAt":"2026-08-13T07:48:40.832Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}