{"record":{"id":"f3835063a8ea7291","repo":"koala73/worldmonitor","slug":"createprolaunchbroadcast-resend-res-status","errorCode":null,"errorMessage":"[createProLaunchBroadcast] Resend ${res.status}: ${body}","messagePattern":"\\[createProLaunchBroadcast\\] Resend (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"convex/broadcast/sendBroadcast.ts","lineNumber":112,"sourceCode":"      headers: {\n        \"Content-Type\": \"application/json\",\n        Authorization: `Bearer ${apiKey}`,\n        \"User-Agent\": USER_AGENT,\n      },\n      body: JSON.stringify({\n        name,\n        segment_id: segmentId,\n        from: PRO_LAUNCH_FROM,\n        reply_to: PRO_LAUNCH_REPLY_TO,\n        subject: PRO_LAUNCH_SUBJECT,\n        html: PRO_LAUNCH_HTML,\n        text: PRO_LAUNCH_TEXT,\n      }),\n    });\n\n    if (!res.ok) {\n      const body = await res.text().catch(() => \"<no body>\");\n      throw new Error(\n        `[createProLaunchBroadcast] Resend ${res.status}: ${body}`,\n      );\n    }\n\n    const json = (await res.json().catch(() => null)) as {\n      id?: string;\n    } | null;\n    if (!json?.id) {\n      throw new Error(\n        `[createProLaunchBroadcast] Resend response missing id: ${JSON.stringify(json)}`,\n      );\n    }\n\n    return {\n      broadcastId: json.id,\n      name,\n      segmentId,\n      subject: PRO_LAUNCH_SUBJECT,","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/koala73/worldmonitor/blob/eeab0a219fce0f02a00603b532dbae9041b934ac/convex/broadcast/sendBroadcast.ts#L94-L130","documentation":"Resend API rejection while creating a broadcast: the POST returned a non-OK HTTP status, and the message embeds the status code and response body. Causes range from an invalid segment_id and auth problems to rate limits (429) — the body text distinguishes them.","triggerScenarios":"Thrown at convex/broadcast/sendBroadcast.ts:112 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded status and body: fix the segment_id or payload for 4xx, retry with backoff for 429/5xx","Verify RESEND_API_KEY is valid and the account has broadcast access","If the segment was deleted in Resend, re-create it before retrying the broadcast"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eeab0a219fce0f02a00603b532dbae9041b934ac","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}