{"record":{"id":"c991c73d7262dbcb","repo":"saadeghi/daisyui","slug":"error-message-n-details","errorCode":null,"errorMessage":"${error.message}\\n${details}","messagePattern":"\\$\\{error\\.message\\}\\\\n\\$\\{details\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwind-play-share/index.mjs","lineNumber":331,"sourceCode":"    stderr = `${stderr}${chunk}`.slice(-8_000)\n  })\n\n  browserProcess.on(\"error\", (error) => {\n    spawnError = error\n  })\n\n  try {\n    const port = await waitForDebuggingPort(\n      profileDirectory,\n      browserProcess,\n      timeoutMs,\n      () => spawnError,\n    )\n    return { browserProcess, port, stderr: () => stderr }\n  } catch (error) {\n    browserProcess.kill(\"SIGTERM\")\n    const details = stderr.trim()\n    throw new Error(details ? `${error.message}\\n${details}` : error.message)\n  }\n}\n\nasync function stopBrowser(browserProcess) {\n  if (!browserProcess || browserProcess.exitCode !== null) return\n\n  browserProcess.kill(\"SIGTERM\")\n  await Promise.race([\n    new Promise((resolvePromise) => browserProcess.once(\"exit\", resolvePromise)),\n    delay(2_000),\n  ])\n\n  if (browserProcess.exitCode === null) {\n    browserProcess.kill(\"SIGKILL\")\n    await new Promise((resolvePromise) => browserProcess.once(\"exit\", resolvePromise))\n  }\n}\n","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/saadeghi/daisyui/blob/42b09e637e09467aa54a813a5aea53c1179aec75/packages/tailwind-play-share/index.mjs#L313-L349","documentation":"launchBrowser wraps waitForDebuggingPort in try/catch. On any failure it kills the browser with SIGTERM, collects the captured stderr (last 8KB), and re-throws an Error whose message is the inner error message optionally followed by a newline and the trimmed stderr. This is the user-facing shape for any launch failure (errors 35, 36, 37).","triggerScenarios":"Any of the inner launch failures: spawn error, early browser exit, or DevTools-port timeout, all surfacing through this wrapper.","commonSituations":"Operator sees a single combined message; the first line identifies which inner failure occurred and the trailing lines are Chrome's own stderr output.","solutions":["Read the first line to classify the failure (spawn / exited / timeout).","Read the trailing stderr lines for Chrome's own diagnostic (missing lib, bad flag, sandbox).","Apply the fix matching the inner failure (see errors 35-37)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await createTailwindPlay({ html, css })\n} catch (error) {\n  const [firstLine, ...rest] = error.message.split('\\n')\n  // firstLine: inner failure (spawn / exited / timeout); rest: Chrome stderr\n  console.error('launch failed:', firstLine, rest.join('\\n'))\n}","preventionTips":["Treat the first line as the failure category and the rest as Chrome's stderr.","Log the full message verbatim for post-mortem.","Map each category to its targeted fix (errors 35-37)."],"tags":["browser","subprocess","chrome","wrapper"],"backgroundTag":null,"analyzedSha":"42b09e637e09467aa54a813a5aea53c1179aec75","analyzedAt":"2026-08-13T04:10:09.555Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}