{"record":{"id":"de921547564ca96a","repo":"langgenius/dify","slug":"command-failed-result-exitcode-formatcomma","errorCode":null,"errorMessage":"Command failed (${result.exitCode}): ${formatCommand(options.command, options.args)}","messagePattern":"Command failed \\((.+?)\\): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"e2e/scripts/common.ts","lineNumber":105,"sourceCode":"  }\n\n  return await new Promise<RunCommandResult>((resolve, reject) => {\n    childProcess.once('error', reject)\n    childProcess.once('exit', (code) => {\n      resolve({\n        exitCode: code ?? 1,\n        stdout,\n        stderr,\n      })\n    })\n  })\n}\n\nexport const runCommandOrThrow = async (options: RunCommandOptions) => {\n  const result = await runCommand(options)\n\n  if (result.exitCode !== 0) {\n    throw new Error(\n      `Command failed (${result.exitCode}): ${formatCommand(options.command, options.args)}`,\n    )\n  }\n\n  return result\n}\n\nexport const getTcpPortListenerDescription = async (port: number) => {\n  if (process.platform === 'win32') return ''\n\n  const result = await runCommand({\n    command: 'lsof',\n    args: ['-nP', `-iTCP:${port}`, '-sTCP:LISTEN'],\n    cwd: rootDir,\n    stdio: 'pipe',\n  })\n\n  if (result.exitCode !== 0) return ''","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/e2e/scripts/common.ts#L87-L123","documentation":"Error \"Command failed (${result.exitCode}): ${formatCommand(options.command, options.args)}\" thrown in langgenius/dify.","triggerScenarios":"Thrown at e2e/scripts/common.ts:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}