Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot call write after a stream was destroyed #155

Open
niftylettuce opened this issue Aug 13, 2020 · 0 comments
Open

Cannot call write after a stream was destroyed #155

niftylettuce opened this issue Aug 13, 2020 · 0 comments

Comments

@niftylettuce
Copy link
Contributor

If you have an onData handler and at the top of it put this, then the following error occurs:

onData(stream, session, fn) {
  stream.once('error', fn);
  stream.destroy(new Error('Oops'));
}
15|smtp    | Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
15|smtp    |     at doWrite (_stream_writable.js:437:19)
15|smtp    |     at writeOrBuffer (_stream_writable.js:425:5)
15|smtp    |     at PassThrough.Writable.write (_stream_writable.js:316:11)
15|smtp    |     at PassThrough.Writable.end (_stream_writable.js:623:10)
15|smtp    |     at SMTPStream._endDataMode (/var/www/production/source/node_modules/smtp-server/lib/smtp-stream.js:257:30)
15|smtp    |     at SMTPStream._feedDataStream (/var/www/production/source/node_modules/smtp-server/lib/smtp-stream.js:175:30)
15|smtp    |     at SMTPStream._write (/var/www/production/source/node_modules/smtp-server/lib/smtp-stream.js:133:18)
15|smtp    |     at doWrite (_stream_writable.js:441:12)
15|smtp    |     at writeOrBuffer (_stream_writable.js:425:5)
15|smtp    |     at SMTPStream.Writable.write (_stream_writable.js:316:11)
niftylettuce added a commit to forwardemail/free-email-forwarding that referenced this issue Aug 13, 2020
titanism pushed a commit to forwardemail/free-email-forwarding that referenced this issue Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant