{"record":{"id":"b5fb1be3d08364e8","repo":"koala73/worldmonitor","slug":"data-message-too-many-requests","errorCode":null,"errorMessage":"data.message || 'Too many requests'","messagePattern":"data\\.message \\|\\| 'Too many requests'","errorType":"http","errorClass":"ApiError","httpStatus":429,"severity":"error","filePath":"server/worldmonitor/leads/v1/submit-contact.ts","lineNumber":199,"sourceCode":"\n  const client = new ConvexHttpClient(convexUrl);\n  try {\n    await client.mutation(api.contactMessages.submit, {\n      name: safeName,\n      email: email.trim(),\n      organization: safeOrg,\n      phone: safePhone,\n      message: safeMsg,\n      source: safeSource,\n    });\n  } catch (err) {\n    // Preserve policy failures from direct Convex enforcement at the HTTP seam\n    // instead of turning expected client errors into opaque 500 responses.\n    // Convex serializes ConvexError payloads onto err.data.\n    if (err instanceof ConvexError) {\n      const data = getConvexPolicyErrorData(err);\n      if (data?.kind === 'rate_limited') {\n        throw new ApiError(429, data.message || 'Too many requests', '');\n      }\n      if (data?.kind === 'FREE_EMAIL_NOT_ALLOWED') {\n        throw new ApiError(422, data.message || 'Please use your work email address', '');\n      }\n    }\n    throw err;\n  }\n\n  const emailSent = await sendNotificationEmail(\n    safeName,\n    email.trim(),\n    safeOrg,\n    safePhone,\n    safeMsg,\n    ip,\n    country,\n  );\n","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/koala73/worldmonitor/blob/a96956387a927b8cd7aa34b0c41fca357e746be9/server/worldmonitor/leads/v1/submit-contact.ts#L181-L217","documentation":"HTTP-layer error in submitContact: the direct Convex contact-messages mutation was rejected with a rate-limit policy failure (ConvexError with data.kind 'rate_limited'). The seam preserves the policy message (defaulting to 'Too many requests') so expected client throttling surfaces as 429 rather than an opaque 500.","triggerScenarios":"Thrown at server/worldmonitor/leads/v1/submit-contact.ts:198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the rate-limit window to pass and resubmit","Avoid duplicate submissions (repeated clicks each consume limit budget)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a96956387a927b8cd7aa34b0c41fca357e746be9","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}