{"record":{"id":"272c493e3ed8e9db","repo":"affaan-m/ECC","slug":"setup-failed","errorCode":"SETUP_FAILED","errorMessage":"${error.message}","messagePattern":"\\$\\{error\\.message\\}","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/setup.js","lineNumber":322,"sourceCode":"    return;\n  }\n  process.stdout.write(`\\nECC ${result.action} ${result.pluginId} at ${result.scope} scope.\\n`);\n  if (result.sourceScope) {\n    process.stdout.write(`Previous scope: ${result.sourceScope}\\n`);\n  }\n  process.stdout.write(`Hook preference: ${result.hooks}\\n`);\n  if (result.restartRequired) {\n    process.stdout.write('Restart Claude Code or run /reload-plugins to load the updated plugin.\\n');\n  }\n}\n\nfunction printError(error, json) {\n  if (json) {\n    const payload = error instanceof ClaudeSetupError\n      ? error.toJSON()\n      : {\n        error: {\n          code: 'SETUP_FAILED',\n          message: error.message,\n          phase: 'cli',\n          observedScopes: [],\n          recovery: [],\n        },\n      };\n    process.stderr.write(`${JSON.stringify(payload, null, 2)}\\n`);\n    return;\n  }\n  process.stderr.write(`Error: ${error.message}\\n`);\n}\n\nfunction isInteractiveCancellation(error) {\n  return Boolean(error && (\n    error.code === 'ABORT_ERR'\n    || /aborted with ctrl\\+d|readline was closed/i.test(error.message || '')\n  ));\n}","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/scripts/setup.js#L304-L340","documentation":"printError is setup's last-resort error reporter: an error escaped the setup flow and its message is printed (or serialized for --json), with structured ClaudeSetupError payloads preserved when available.","triggerScenarios":"Triggered when setup.js rejects the current invocation: <value>","commonSituations":"Occurs while running scripts/setup.js with invalid arguments, missing flags, or a failing external dependency; the guard at scripts/setup.js:322 aborts the command with this message.","solutions":["Inspect the underlying error detail in the message (stderr/log/HTTP status), fix the cause, and retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06c5e118c4d3e6c3b7f9445f973a2194c82de193","analyzedAt":"2026-08-18T11:27:13.915Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}