{"record":{"id":"81ebce483623e016","repo":"hcengineering/platform","slug":"platform-status-internalservererror","errorCode":"platform.status.InternalServerError","errorMessage":"Internal server error","messagePattern":"Internal server error","errorType":"http","errorClass":"PlatformError","httpStatus":500,"severity":"error","filePath":"packages/integration-client/src/request.ts","lineNumber":90,"sourceCode":"\n    try {\n      return JSON.parse(text)\n    } catch (error) {\n      console.warn('Failed to parse JSON response:', text, error)\n      return undefined\n    }\n  } else if (response.status === 202) {\n    return undefined\n  } else if (response.status === 401) {\n    throw new PlatformError(new Status(Severity.ERROR, platform.status.Unauthorized, {}))\n  } else if (response.status === 403) {\n    throw new PlatformError(new Status(Severity.ERROR, platform.status.Forbidden, {}))\n  } else if (response.status === 404) {\n    throw new PlatformError(\n      new Status(Severity.ERROR, platform.status.ResourceNotFound, { resource: options.path ?? '' })\n    )\n  } else if (response.status >= 500) {\n    throw new PlatformError(new Status(Severity.ERROR, platform.status.InternalServerError, {}))\n  } else {\n    throw new PlatformError(new Status(Severity.ERROR, platform.status.BadRequest, { status: response.status }))\n  }\n}\n","sourceCodeStart":72,"sourceCodeEnd":95,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/packages/integration-client/src/request.ts#L72-L95","documentation":"The integration client maps any HTTP 5xx response to PlatformError with status.InternalServerError and message 'Internal server error'. The server failed while processing a valid request; the client did nothing wrong.","triggerScenarios":"Any request() call where the integration service responds with status >= 500.","commonSituations":"Integration service crash or unhandled exception; downstream dependency of the service failing; deploy in progress; resource exhaustion on the server.","solutions":["Retry with exponential backoff — 5xx is often transient.","Inspect the integration service's server logs for the corresponding stack trace.","Check service health/status endpoint and recent deploys.","Escalate to the service owners if 5xx persists."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"function isInternalServerError (err: unknown): err is PlatformError {\n  return err instanceof PlatformError && (err.status.code as number) === platform.status.InternalServerError\n}","tryCatchPattern":"try {\n  return await client.request(...)\n} catch (err) {\n  if (isInternalServerError(err)) {\n    return await retryWithBackoff(() => client.request(...), { retries: 3, baseDelayMs: 500 })\n  }\n  throw err\n}","preventionTips":["Always wrap integration-client calls in retry with exponential backoff.","Monitor server-side 5xx rates and alert on spikes.","Avoid importing/mutating during known maintenance windows."],"tags":["http-500","server-error","retry"],"backgroundTag":"internal-server-error","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}