Skip to content

Commit

Permalink
fix(client): adding the handler for error
Browse files Browse the repository at this point in the history
  • Loading branch information
BastienJard06 authored and kylefarris committed Mar 18, 2024
1 parent e04d635 commit f88a57b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,12 @@ class NodeClam {
);
return hasCb ? cb(err, null) : reject(err);
});
client.on('error', (err) => {
if(this.settings.debugMode) {
console.log(`${this.debugLabel}: Could not connect to the clamscan server.`, err);
}
return hasCb ? cb(err, null) : reject(err);
});
} catch (err) {
return hasCb ? cb(err, false) : reject(err);
}
Expand Down

0 comments on commit f88a57b

Please sign in to comment.