{"record":{"id":"adde06e6e1ddf7d6","repo":"different-ai/openwork","slug":"resend-network","errorCode":"resend_network","errorMessage":"[${input.template}] email for ${input.recipient} failed: ${input.reason}${input.detail ? ` (${input.detail})` : \"\"}","messagePattern":"\\[(.+?)\\] email for (.+?) failed: (.+?)(.+?)\\)` : \"\"\\}","errorType":"exception","errorClass":"EmailSendError","httpStatus":null,"severity":"error","filePath":"packages/email/src/send-email.ts","lineNumber":150,"sourceCode":"      replyTo: input.replyTo,\n      html: input.html,\n      text: input.text,\n    })\n\n    if (result.error) {\n      throw new EmailSendError({\n        template: input.template,\n        reason: \"resend_rejected\",\n        recipient: input.to,\n        detail: result.error.message,\n      })\n    }\n  } catch (error) {\n    if (error instanceof EmailSendError) {\n      throw error\n    }\n    const message = error instanceof Error ? error.message : \"Unknown error\"\n    throw new EmailSendError({ template: input.template, reason: \"resend_network\", recipient: input.to, detail: message })\n  }\n}\n\nasync function sendViaNodemailer(input: {\n  to: string\n  subject: string\n  replyTo?: string\n  html: string\n  text: string\n  template: EmailTemplate\n  config: EmailSendConfig\n}) {\n  const from = input.config.from\n  const smtp = input.config.smtp\n  if (!from || !smtp?.host) {\n    throw emailNotConfigured({\n      template: input.template,\n      recipient: input.to,","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/packages/email/src/send-email.ts#L132-L168","documentation":"The Resend transport path wraps any exception that is not already an EmailSendError in EmailSendError with reason \"resend_network\". This signals a transport-level failure talking to Resend (DNS, TLS, timeout, connection reset) rather than an API-level rejection, with the underlying message preserved in detail.","triggerScenarios":"An exception thrown while awaiting the Resend SDK's emails.send call — fetch failure, timeout, socket hang-up, 5xx surfaced as a thrown network error — inside sendViaResend's try/catch.","commonSituations":"No outbound network access or DNS failure in the runtime environment; corporate proxy/firewall blocking api.resend.com; TLS interception certificates not trusted by Node; transient Resend outages; missing proxy configuration in containers/CI.","solutions":["Check outbound connectivity to api.resend.com (DNS, firewall, proxy) from the environment running the send","Retry the send — network failures are often transient; consider adding a retry with backoff around sendEmail","If behind a corporate proxy, configure HTTPS_PROXY / NODE_EXTRA_CA_CERTS appropriately","Check Resend's status page for ongoing incidents","Inspect detail in the EmailSendError for the underlying message (e.g. getaddrinfo ENOTFOUND, certificate errors)"],"exampleFix":"// before\nawait sendEmail({ template: 'invite', to: addr }) // one-shot, fails on blips\n// after\ntry {\n  await sendEmail({ template: 'invite', to: addr })\n} catch (e) {\n  if (e instanceof EmailSendError && e.reason === 'resend_network') await retryWithBackoff(() => sendEmail({ template: 'invite', to: addr }))\n  else throw e\n}","handlingStrategy":"retry","validationCode":"// pre-flight connectivity check\nconst reachable = await fetch('https://api.resend.com', { method: 'HEAD' }).then(() => true).catch(() => false);\nif (!reachable) console.warn('api.resend.com unreachable — sends will fail with resend_network');","typeGuard":null,"tryCatchPattern":"try {\n  await sendEmail({ template, to })\n} catch (e) {\n  if (e instanceof EmailSendError && e.reason === 'resend_network') {\n    await retryWithBackoff(() => sendEmail({ template, to }), { attempts: 3 })\n  } else throw e\n}","preventionTips":["Add retry with exponential backoff for network-class send failures","Ensure outbound HTTPS to api.resend.com (proxy/firewall/egress rules)","Set NODE_EXTRA_CA_CERTS in environments with TLS interception","Monitor Resend's status page and alert on elevated network errors"],"tags":["email","resend","network","transient"],"backgroundTag":"email-send-failed","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}