Hello, first of all I'd like to thank you for such a cool library. I've been trying to use it for some project of mine and it worked really well most of the time, except for some invalid addresses which caused this issue:
Exception in PromiseRejectCallback:
internal/process/promises.js:94
function resolveError(type, promise, reason) {
^
RangeError: Maximum call stack size exceeded
internal/errors.js:309
err.stack;
^
RangeError: Maximum call stack size exceeded
at addCodeToName (internal/errors.js:309:7)
at new NodeError (internal/errors.js:270:7)
at doWrite (_stream_writable.js:399:19)
at writeOrBuffer (_stream_writable.js:387:5)
at Socket.Writable.write (_stream_writable.js:318:11)
at Socket.<anonymous> (/home/ialex/Projects/Node/deep-email-validator/dist/smtp/smtp.js:40:20)
at Socket.emit (events.js:315:20)
at Socket.EventEmitter.emit (domain.js:482:12)
at Socket.<anonymous> (/home/ialex/Projects/Node/deep-email-validator/dist/smtp/smtp.js:31:20)
at Socket.emit (events.js:315:20)
Upon further investigation, the issue occurred when the fail event of the socket was triggered by writing to an already closed socket. This caused the event to be triggered again due to this exception, all while trying to resolve the promise (possibly due to the error event being triggered by writing to a closed socket?).
Anyhow, I've opened PR #2 which adds some checks before writing to the socket and it seems the error goes away while returning an invalid address status:
Hello, first of all I'd like to thank you for such a cool library. I've been trying to use it for some project of mine and it worked really well most of the time, except for some invalid addresses which caused this issue:
Upon further investigation, the issue occurred when the
fail
event of the socket was triggered by writing to an already closed socket. This caused the event to be triggered again due to this exception, all while trying to resolve the promise (possibly due to theerror
event being triggered by writing to a closed socket?).Anyhow, I've opened PR #2 which adds some checks before writing to the socket and it seems the error goes away while returning an invalid address status: