{"record":{"id":"43184a925b2517ac","repo":"usebruno/bruno","slug":"could-not-reach-the-mock-server","errorCode":null,"errorMessage":"Could not reach the mock server","messagePattern":"Could not reach the mock server","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-app/src/utils/mock-server/mock-responses.js","lineNumber":172,"sourceCode":"    if (!headers['Content-Type'] && !headers['content-type']) {\n      headers['Content-Type'] = 'text/plain';\n    }\n  }\n\n  return {\n    url,\n    method,\n    headers,\n    body: requestBody\n  };\n};\n\nexport const tryMockResponseRequest = async (options) => {\n  const payload = buildMockServerTryRequest(options);\n  const result = await window.ipcRenderer.invoke('renderer:mock-server-try-request', payload);\n\n  if (!result?.success) {\n    throw new Error(result?.error || 'Could not reach the mock server');\n  }\n\n  return result;\n};\n\nexport const resolveMockResponseCollection = ({\n  collection,\n  instance,\n  collections = [],\n  activeWorkspace = null\n}) => {\n  if (collection?.uid) {\n    return collection;\n  }\n\n  if (instance?.collectionUid) {\n    const instanceCollection = collections.find((item) => item.uid === instance.collectionUid);\n    if (instanceCollection) {","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-app/src/utils/mock-server/mock-responses.js#L154-L190","documentation":"Thrown by tryMockResponseRequest after the IPC call 'renderer:mock-server-try-request' returns a result whose success flag is falsy. If result.error exists it is used as the message, otherwise this default text is shown. It indicates the main process mock server handler rejected or never answered the try-request.","triggerScenarios":"Invoking tryMockResponseRequest({url, method, headers, body}) when the backend mock server is not running, the route matches no registered mock, the IPC handler errored, or result came back undefined/null.","commonSituations":"Mock server not started for the workspace, mock matchings not yet saved/persisted, IPC channel name changed after an Electron/Bruno update, or a backend crash during the try-request.","solutions":["Ensure the mock server is started for the current workspace before trying a response.","Save the mock response (so it is persisted and registered) before issuing a try-request.","Restart Bruno to re-initialize the IPC handler if the channel appears dead.","Check main-process logs for the underlying result.error and address that specifically."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!window?.ipcRenderer?.invoke) {\n  throw new Error('IPC bridge unavailable');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await tryMockResponseRequest(options);\n} catch (err) {\n  if (err.message === 'Could not reach the mock server') {\n    // start/restart the mock server, save the mock response, then retry once\n  }\n  throw err;\n}","preventionTips":["Start the mock server for the workspace before issuing try-requests.","Save mock responses so they are registered before trying.","Restart Bruno if the IPC channel appears unresponsive.","Inspect result.error in the main-process logs for the real cause."],"tags":["mock-server","ipc","network","electron"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}