{"record":{"id":"62e7832067225f67","repo":"denoland/deno","slug":"build-failed-exit-code","errorCode":null,"errorMessage":"{} build failed (exit code: {})","messagePattern":"(.+?) build failed \\(exit code: (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/framework.rs","lineNumber":148,"sourceCode":"  dir: &Path,\n) -> Result<(), AnyError> {\n  let Some(build_cmd) = &detection.build_command else {\n    return Ok(());\n  };\n  log::info!(\n    \"{} {} project...\",\n    deno_terminal::colors::green(\"Building\"),\n    detection.name,\n  );\n  let status = std::process::Command::new(&build_cmd[0])\n    .args(&build_cmd[1..])\n    .current_dir(dir)\n    .status()\n    .with_context(|| {\n      format!(\"Failed to run build command: {}\", build_cmd.join(\" \"))\n    })?;\n  if !status.success() {\n    deno_core::anyhow::bail!(\n      \"{} build failed (exit code: {})\",\n      detection.name,\n      status.code().unwrap_or(-1)\n    );\n  }\n  Ok(())\n}\n\n/// Detect a web framework in the given directory.\n///\n/// Detection priority:\n/// 1. Config-file based detection (highest priority)\n/// 2. Package.json dependency-based detection\n/// 3. deno.json import-based detection\npub fn detect_framework(\n  dir: &Path,\n) -> Result<Option<FrameworkDetection>, AnyError> {\n  // --- Config-file based detection (highest priority) ---","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/framework.rs#L130-L166","documentation":"Error \"{} build failed (exit code: {})\" thrown in denoland/deno.","triggerScenarios":"Thrown at cli/tools/framework.rs:148 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":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}