paperclipai/paperclip · error

Internal server error

Error message

Internal server error

What it means

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.

Source

Thrown at server/src/middleware/error-handler.ts:153

  if (zodIssues) {
    res.status(400).json({ error: "Validation error", details: zodIssues });
    return;
  }

  const rootError = err instanceof Error ? err : new Error(String(err));
  attachErrorContext(
    req,
    res,
    err instanceof Error
      ? { message: err.message, stack: err.stack, name: err.name }
      : { message: String(err), raw: err, stack: rootError.stack, name: rootError.name },
    rootError,
  );

  const tc = getTelemetryClient();
  if (tc) trackErrorHandlerCrash(tc, { errorCode: rootError.name });

  res.status(500).json({
    error: "Internal server error",
    ...(shouldExposeTrustedCloudTenantImportError(req) ? { message: rootError.message } : {}),
  });
}

function shouldExposeTrustedCloudTenantImportError(req: Request) {
  return req.actor?.source === "cloud_tenant"
    && req.method === "POST"
    && req.originalUrl.split("?")[0] === COMPANY_IMPORT_API_PATH;
}

View on GitHub (pinned to a7e689b3c3)

Solutions

  1. Check the server logs for the underlying exception, fix the cause, and retry the request.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at server/src/middleware/error-handler.ts:146 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of paperclipai/paperclip@a7e689b3c3 (2026-08-18). Data as JSON: /api/errors/c582853139339658. Report an issue: GitHub.