{"record":{"id":"447eadddd52e6c3b","repo":"overleaf/overleaf","slug":"error-info-code","errorCode":"error.info.code","errorMessage":"error.message","messagePattern":"error\\.message","errorType":"error_code","errorClass":"CodedError","httpStatus":null,"severity":"error","filePath":"services/real-time/app/js/Router.js","lineNumber":58,"sourceCode":"    attrs.client_id = client.id\n    attrs.err = error\n    attrs.method = method\n    if (attrs.validation && isZodErrorLike(error)) {\n      logger.info(attrs, 'validation error')\n      let message = 'invalid'\n      try {\n        message = error.issues[0].message\n      } catch (e) {\n        // ignore unexpected errors\n        logger.warn({ error, e }, 'unexpected validation error')\n      }\n      const serializedError = { message }\n      metrics.inc('validation-error', 1, {\n        status: method,\n      })\n      callback(serializedError)\n    } else if (error.name === 'CodedError') {\n      logger.warn(attrs, error.message)\n      const serializedError = { message: error.message, code: error.info.code }\n      callback(serializedError)\n    } else if (error.message === 'unexpected arguments') {\n      // the payload might be very large; put it on level debug\n      logger.debug(attrs, 'unexpected arguments')\n      metrics.inc('unexpected-arguments', 1, { status: method })\n      const serializedError = { message: error.message }\n      callback(serializedError)\n    } else if (error.message === 'no project_id found on client') {\n      logger.debug(attrs, error.message)\n      const serializedError = { message: error.message }\n      callback(serializedError)\n    } else if (\n      [\n        'not authorized',\n        'joinLeaveEpoch mismatch',\n        'doc updater could not load requested ops',\n        'no project_id found on client',","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/overleaf/overleaf/blob/28ad3b03b71cb4311decdcb55c36b33ec10d72db/services/real-time/app/js/Router.js#L40-L76","documentation":"In real-time Router._handleError's validation branch: error.message is extracted from the first Zod issue of a Zod-like validation error detected by isZodErrorLike. It is a generic guard — the fault is an invalid argument payload for the realtime method, and the first issue's message is serialized back to the client as { message } with a validation-error metric.","triggerScenarios":"Thrown at services/real-time/app/js/Router.js:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log/inspect error.issues to see every failing field, not just the first","Fix the client payload to satisfy the Zod schema for the realtime method","Keep the method's Zod schema in sync with the documented message contract","Add schema tests so payload regressions are caught before deploy"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"28ad3b03b71cb4311decdcb55c36b33ec10d72db","analyzedAt":"2026-09-03T02:10:22.807Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}