{"record":{"id":"1d1287a3d81e884e","repo":"koala73/worldmonitor","slug":"data-message-please-use-your-work-email-addres","errorCode":null,"errorMessage":"data.message || 'Please use your work email address'","messagePattern":"data\\.message \\|\\| 'Please use your work email address'","errorType":"http","errorClass":"ApiError","httpStatus":422,"severity":"error","filePath":"server/worldmonitor/leads/v1/submit-contact.ts","lineNumber":202,"sourceCode":"    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\n  return { status: 'sent', emailSent };\n}\n","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/koala73/worldmonitor/blob/a96956387a927b8cd7aa34b0c41fca357e746be9/server/worldmonitor/leads/v1/submit-contact.ts#L184-L220","documentation":"HTTP-layer error in submitContact: the direct Convex contact-messages mutation was rejected by the disposable/personal-email policy (data.kind for email policy). The seam maps it to a 4xx with 'Please use your work email address' instead of an opaque 500, preserving the policy failure at the HTTP boundary.","triggerScenarios":"Thrown at server/worldmonitor/leads/v1/submit-contact.ts:201 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Submit using a work/corporate email address","Check for typos in the email domain — policy checks match disposable or personal-provider domains"],"exampleFix":null,"handlingStrategy":"validation","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-14T05:17:10.506Z"}