Skip to content

Handling ECONNRESET exceptions #21

@stefanolaru

Description

@stefanolaru

Hi,

Thank you for writing this client, it's really helpful.

Running it in an AWS Lambda (node 18) and occasionally it throws ECONNRESET. Some SMTP servers seem to terminate the connection when I attempt the MAIL command.

ERROR	Uncaught Exception 	{
    "errorType": "Error",
    "errorMessage": "read ECONNRESET",
    "code": "ECONNRESET",
    "errno": -104,
    "syscall": "read",
    "stack": [
        "Error: read ECONNRESET",
        "    at TCP.onStreamRead (node:internal/stream_base_commons:217:20)"
    ]
}

For some reason I'm not able to catch the ECONNRESET, it doesn't trigger the on('error') listener, nor with try/catch.

Any idea how to handle this type of exception?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions