{"record":{"id":"4fe6bf2b9bd785c8","repo":"paperclipai/paperclip","slug":"validation-error","errorCode":null,"errorMessage":"Validation error","messagePattern":"Validation error","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/src/middleware/error-handler.ts","lineNumber":232,"sourceCode":"              ? { subject: responseDetails.subject }\n              : {}),\n            ...(structuredConnectionError &&\n            typeof responseDetails?.grantId === \"string\"\n              ? { grantId: responseDetails.grantId }\n              : {}),\n            ...(!redactedSkillPolicyDenial &&\n            !workspaceRepairPreconditionFailure &&\n            responseDetailsValue\n              ? { details: responseDetailsValue }\n              : {}),\n          },\n    );\n    return;\n  }\n\n  const zodIssues = readZodIssues(err);\n  if (zodIssues) {\n    res.status(400).json({\n      error: \"Validation error\",\n      details: sanitizeSecretSensitiveResponse(req, zodIssues),\n    });\n    return;\n  }\n\n  const rootError = err instanceof Error ? err : new Error(String(err));\n\n  // The client tore down the connection mid-request (closed tab, dropped\n  // mobile network, cancelled upload): Node surfaces it as `Error: aborted`\n  // with ECONNRESET. There is no server fault to report and nobody left to\n  // answer, so skip the error sinks and just close out the response.\n  if (\n    rootError.message === \"aborted\" &&\n    (rootError as NodeJS.ErrnoException).code === \"ECONNRESET\"\n  ) {\n    if (!res.headersSent) res.status(499);\n    res.end();","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/server/src/middleware/error-handler.ts#L214-L250","documentation":"Zod branch of the central Express error handler: a request handler threw a ZodError (parsed request body/query failed its schema), so the middleware converts the issues into a 400 'Validation error' response with the flattened issue list instead of a 500.","triggerScenarios":"Thrown at server/src/middleware/error-handler.ts:129 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the request payload according to the validation error details and retry."],"exampleFix":null,"handlingStrategy":"validation","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"}