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

Fix the problem reported in #102 #105

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix the problem reported in #102
Proper error handling in scanStream method.
  • Loading branch information
benzino77 committed Aug 10, 2022
commit beab5e553e3ae7208640baef9ff22d43f04c5c0e
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2281,6 +2281,9 @@ class NodeClam {
if (this.settings.debugMode)
console.log(`${this.debugLabel}: Raw Response: ${response.toString('utf8')} `);
const result = this._processResult(response.toString('utf8'), null);
if (result instanceof Error) {
return hasCb ? cb(result, null) : reject(result);
}
return hasCb ? cb(null, result) : resolve(result);
});
} catch (err) {
Expand Down