Wraps Logo
DocsHome
Reference

Error Codes & Troubleshooting

Complete reference for all CLI error codes and SDK error classes, with solutions for each.

CLI Error Codes

Credential Errors

CodeMessageSolution
CREDENTIALS_NOT_FOUNDAWS credentials not foundRun wraps aws setup or configure AWS CLI
CREDENTIALS_EXPIREDAWS credentials have expiredRefresh with aws sso login or update access keys
INVALID_CREDENTIALSAWS credentials are invalidCheck access key and secret key are correct

IAM & Permission Errors

CodeMessageSolution
MISSING_PERMISSIONSInsufficient IAM permissionsRun wraps permissions to see required permissions
ROLE_NOT_FOUNDIAM role not foundRun wraps email init to create the role
OIDC_PROVIDER_ERRORFailed to create OIDC providerCheck if provider already exists in IAM console

Stack & Deployment Errors

CodeMessageSolution
STACK_NOT_FOUNDPulumi stack not foundRun wraps email init to create infrastructure
STACK_CONFLICTStack operation in progressWait for the current operation to complete
DEPLOYMENT_FAILEDInfrastructure deployment failedCheck AWS CloudFormation console for details

Email Errors

CodeMessageSolution
DOMAIN_NOT_VERIFIEDDomain not verified in SESRun wraps email domains verify -d yourdomain.com
SES_SANDBOXSES is in sandbox modeFollow production access guide
SENDING_DISABLEDEmail sending not enabledRun wraps email upgrade to enable sending

SMS Errors

CodeMessageSolution
PHONE_NOT_VERIFIEDPhone number not verifiedRun wraps sms verify-number
SMS_SANDBOXSMS in sandbox modeRegister toll-free number with wraps sms register
OPT_OUTRecipient opted outRemove from opt-out list or use different number

SMTP Errors

CodeMessageSolution
SMTP_CREDENTIALS_FAILEDSMTP credentials creation failedCheck IAM permissions for SES
SMTP_CONNECTION_FAILEDCannot connect to SMTP endpointVerify region and port (587 or 465)

State Errors

CodeMessageSolution
METADATA_NOT_FOUNDConnection metadata not foundRun wraps email init or wraps email restore
METADATA_CORRUPTConnection metadata is corruptDelete ~/.wraps/connections/ and re-init
CONFIG_NOT_FOUNDwraps.config.ts not foundRun wraps email templates init

Template Errors

CodeMessageSolution
TEMPLATE_COMPILE_ERRORTemplate compilation failedCheck React component syntax
TEMPLATE_NOT_FOUNDSES template not foundRun wraps email templates push

SDK Error Classes

Email SDK (@wraps.dev/email)

SESError

Thrown when an AWS SES API call fails.

PropertyTypeDescription
codestringMessageRejected, Throttling, AccountSuspended, MailFromDomainNotVerified
requestIdstringAWS request identifier
retryablebooleanWhether the request can be retried
DynamoDBError

Thrown when an email history read/write operation fails.

PropertyTypeDescription
codestringDynamoDB error code
requestIdstringAWS request identifier
retryablebooleanWhether the request can be retried
ValidationError

Thrown when input parameters are invalid.

PropertyTypeDescription
fieldstringWhich field failed validation
messagestringHuman-readable error description

SMS SDK (@wraps.dev/sms)

SMSError

Thrown when an AWS End User Messaging API call fails.

PropertyTypeDescription
codestringAWS error code
retryablebooleanWhether the request can be retried
ValidationError

Thrown when input parameters are invalid.

PropertyTypeDescription
fieldstringWhich field failed validation
messagestringHuman-readable error description
OptedOutError

Thrown when the recipient has opted out of receiving messages.

PropertyTypeDescription
phoneNumberstringThe phone number that opted out
RateLimitError

Thrown when the sending rate limit has been exceeded.

PropertyTypeDescription
retryAfternumberSeconds to wait before retrying

No Automatic Retries

The SDKs do NOT automatically retry failed requests. If retryable is true, implement your own retry logic using the pattern below.

Retry Pattern

Use exponential backoff when retrying failed requests. This example uses a simple retry loop with increasing delays.

TypeScriptretry-pattern.ts
import { WrapsEmail, SESError } from '@wraps.dev/email';const email = new WrapsEmail();async function sendWithRetry(params, maxRetries = 3) {  for (let attempt = 0; attempt < maxRetries; attempt++) {    try {      return await email.send(params);    } catch (error) {      if (error instanceof SESError && error.retryable && attempt < maxRetries - 1) {        await new Promise(r => setTimeout(r, Math.pow(2, attempt) * 1000));        continue;      }      throw error;    }  }}

Error Handling Example

Catch and handle specific error types to provide appropriate responses in your application.

TypeScripterror-handling.ts
import { WrapsEmail, SESError, DynamoDBError, ValidationError } from '@wraps.dev/email';const email = new WrapsEmail();try {  await email.send({    from: 'hello@yourdomain.com',    to: 'user@example.com',    subject: 'Hello',    html: '<p>Hello!</p>',  });} catch (error) {  if (error instanceof ValidationError) {    console.error('Invalid input:', error.field, error.message);  } else if (error instanceof SESError) {    console.error('SES error:', error.code, error.retryable);  } else if (error instanceof DynamoDBError) {    console.error('DynamoDB error:', error.code, error.retryable);  }}

Next Steps

Email SDK

Full API reference for the @wraps.dev/email TypeScript SDK.

View Reference
SMS SDK

Full API reference for the @wraps.dev/sms TypeScript SDK.

View Reference
AWS Setup

Configure AWS credentials and permissions for Wraps.

View Guide