{"record":{"id":"1c5f113e656aa8c5","repo":"oven-sh/bun","slug":"server-responded-with-code-response-status","errorCode":null,"errorMessage":"server responded with code ${response.status}","messagePattern":"server responded with code (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/runner.node.mjs","lineNumber":1891,"sourceCode":"            }\n          }\n        }\n      }\n    }\n\n    // Skip this if the remap server didn't work or if Bun exited normally\n    // (tests in which a subprocess crashed should at least set exit code 1)\n    if (typeof remapPort == \"number\" && result.exitCode !== 0) {\n      try {\n        // When Bun crashes, it exits before the subcommand it runs to upload the crash report has necessarily finished.\n        // So wait a little bit to make sure that the crash report has at least started uploading\n        // (once the server sees the /ack request then /traces will wait for any crashes to finish processing)\n        // There is a bug that if a test causes crash reports but exits with code 0, the crash reports will instead\n        // be attributed to the next test that fails. I'm not sure how to fix this without adding a sleep in between\n        // all tests (which would slow down CI a lot).\n        await setTimeoutPromise(500);\n        const response = await fetch(`http://localhost:${remapPort}/traces`);\n        if (!response.ok || response.status !== 200) throw new Error(`server responded with code ${response.status}`);\n        const traces = await response.json();\n        if (traces.length > 0) {\n          result.ok = false;\n          if (!isAlwaysFailure(result.error)) result.error = \"crash reported\";\n\n          crashes += `${traces.length} crashes reported during this test\\n`;\n          for (const t of traces) {\n            if (t.failed_parse) {\n              crashes += \"Trace string failed to parse:\\n\";\n              crashes += t.failed_parse + \"\\n\";\n            } else if (t.failed_remap) {\n              crashes += \"Parsed trace failed to remap:\\n\";\n              crashes += JSON.stringify(t.failed_remap, null, 2) + \"\\n\";\n            } else {\n              crashes += \"================\\n\";\n              crashes += t.remap + \"\\n\";\n            }\n          }","sourceCodeStart":1873,"sourceCodeEnd":1909,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/scripts/runner.node.mjs#L1873-L1909","documentation":"Error \"server responded with code ${response.status}\" thrown in oven-sh/bun.","triggerScenarios":"Thrown at scripts/runner.node.mjs:1891 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":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}