Closed jobachhu closed 4 years ago
That's interesting. I'm now wondering if I accidentally left out some kind of error handling there or if there was a reason I didn't have it there (hard to test, etc...)? I just merged another PR in yesterday so I'll see if I can figure this out before creating a new patch that will include a fix for this as well as that PR merge.
Thanks for submitting the bug, BTW...
Actually, it looks like someone already put a PR (#39) in to fix this but I apparently missed it. I've merged the change in.
I released a new minor version on NPM: v1.3.0.
Thanks for the quick response! Just upgraded and it works like a charm 👍
Hi,
I'm setting up clamscan to work with a clamd via a TCP socket using the passthrough() stream to check files that are uploaded. It's working fine but while I was testing different error conditions, I was unable to handle the error when the clamd server is not available. No error is thrown, it just logs a message and then waits until it times out.
This is the log message:
Here's the basic setup (some parts omitted for brevity):
The error seems to originate here in the code and it doesn't look like this error is propagated out in any way. Is there any way to react to the error? It seems like clamscan learns of the error, but my code waits for a timeout. If the server is unavailable, I'd like to reject the request with an error status instead of waiting.
Thanks in advance for the help!