{"record":{"id":"87dde455a56e9986","repo":"eyaltoledano/claude-task-master","slug":"set-response-language-error","errorCode":"SET_RESPONSE_LANGUAGE_ERROR","errorMessage":"${error.message}","messagePattern":"\\$\\{error\\.message\\}","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/modules/task-manager/response-language.js","lineNumber":80,"sourceCode":"\t\t\t\t\tcode: 'WRITE_ERROR',\n\t\t\t\t\tmessage: 'Error writing updated configuration to configuration file'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\tresponseLanguage: lang,\n\t\t\t\tmessage: successMessage\n\t\t\t}\n\t\t};\n\t} catch (error) {\n\t\treport('error', `Error setting response language: ${error.message}`);\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\tcode: 'SET_RESPONSE_LANGUAGE_ERROR',\n\t\t\t\tmessage: error.message\n\t\t\t}\n\t\t};\n\t}\n}\n\nexport default setResponseLanguage;\n","sourceCodeStart":62,"sourceCodeEnd":88,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/task-manager/response-language.js#L62-L88","documentation":"Catch-all wrapper in setResponseLanguage(): any unexpected exception after the initial validation (config read, language application, or config write) is caught and returned under SET_RESPONSE_LANGUAGE_ERROR with the original error message. It signals an unanticipated failure rather than a validation rejection.","triggerScenarios":"Any throw inside the try block: getConfig() failing on malformed JSON in .taskmaster/config.json, writeConfig throwing an fs exception (EACCES/ENOENT/EISDIR), or config-merge helpers erroring on an unexpected config shape.","commonSituations":"Hand-edited config with invalid JSON; config path existing but being a directory; read-only mount raising EACCES on write; schema drift after manual migration between task-master versions.","solutions":["Inspect the wrapped error.message — it names the real cause (JSON parse error, EACCES, etc.).","Validate the config: `node -e \"JSON.parse(require('fs').readFileSync('.taskmaster/config.json','utf8'))\"` and fix or regenerate via `task-master init`.","Confirm the file is writable and the process runs from the correct project root.","Update task-master to the latest version; report a bug with the message if the throw originates in library code."],"exampleFix":"// before\nawait setResponseLanguage('spanish', projectRoot); // SET_RESPONSE_LANGUAGE_ERROR: EACCES: permission denied\n// after\n$ chmod u+w .taskmaster/config.json\nawait setResponseLanguage('spanish', projectRoot);","handlingStrategy":"try-catch","validationCode":"const fs = require('fs');\nconst cfgPath = '.taskmaster/config.json';\nif (fs.existsSync(cfgPath)) JSON.parse(fs.readFileSync(cfgPath, 'utf8')); // early failure on corrupt JSON\nfs.accessSync(cfgPath, fs.constants.W_OK); // early failure on permissions","typeGuard":null,"tryCatchPattern":"try {\n  const res = await setResponseLanguage(lang, projectRoot);\n  if (!res.success && res.error?.code === 'SET_RESPONSE_LANGUAGE_ERROR') {\n    console.error(`setResponseLanguage failed: ${res.error.message}`);\n  }\n} catch (e) {\n  console.error('Unhandled response-language failure:', e);\n}","preventionTips":["Validate config JSON and file permissions before invoking config-mutation APIs.","Log the wrapped error.message — it contains the underlying fs/parse cause.","Avoid manual schema edits; use task-master commands so the config stays valid.","Pin task-master versions in CI to avoid unexpected schema or behavior changes."],"tags":["exception","configuration","filesystem"],"backgroundTag":"unexpected-exception-wrapped","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}