Reference

Errors

Handle stable sently error codes and provider-specific error instances.

All library transport and protocol failures derive from SentlyError; use sentlyCode for stable handling.

import { SentlyError } from "sently/errors";

try {
  await mailer.send(message);
} catch (error) {
  if (error instanceof SentlyError) console.error(error.sentlyCode);
}

Provider error classes also retain provider response details where their transport exposes them.