{"record":{"id":"c582853139339658","repo":"paperclipai/paperclip","slug":"internal-server-error","errorCode":null,"errorMessage":"Internal server error","messagePattern":"Internal server error","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"server/src/middleware/error-handler.ts","lineNumber":273,"sourceCode":"  attachErrorContext(\n    req,\n    res,\n    isSecretSensitiveHttpRequest(req.method, req.originalUrl)\n      ? { message: reportableError.message, name: reportableError.name }\n      : err instanceof Error\n        ? { message: err.message, stack: err.stack, name: err.name }\n        : {\n            message: String(err),\n            raw: err,\n            stack: rootError.stack,\n            name: rootError.name,\n          },\n    reportableError,\n  );\n\n  reportCrash(reportableError);\n\n  res.status(500).json({\n    error: \"Internal server error\",\n    ...(shouldExposeTrustedCloudTenantImportError(req)\n      ? { message: rootError.message }\n      : {}),\n  });\n}\n\nfunction shouldExposeTrustedCloudTenantImportError(req: Request) {\n  return (\n    req.actor?.source === \"cloud_tenant\" &&\n    req.method === \"POST\" &&\n    req.originalUrl.split(\"?\")[0] === COMPANY_IMPORT_API_PATH\n  );\n}\n","sourceCodeStart":255,"sourceCodeEnd":288,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/server/src/middleware/error-handler.ts#L255-L288","documentation":"Terminal branch of the central Express error handler: an unhandled non-Zod error escaped a route handler. The middleware scrubs it to an opaque 500 'Internal server error', attaches error context for diagnostics, and reports the crash code to telemetry before responding.","triggerScenarios":"Thrown at server/src/middleware/error-handler.ts:146 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the server logs for the underlying exception, fix the cause, and retry the request."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}