-
Notifications
You must be signed in to change notification settings - Fork 30
throw exception in case of unexpected response #37
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
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThe Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/ClamAV/ClamAV.php(1 hunks)
🔇 Additional comments (3)
src/ClamAV/ClamAV.php (3)
133-137: Good defensive validation for daemon response.The null/empty check correctly handles edge cases where the ClamAV daemon may not respond or return an invalid response.
139-146: Response parsing looks correct for the expected format.The validation ensures we have at least path and status components. Note: paths containing colons would cause issues, but this is a pre-existing limitation shared with
fileScanInStreamandcontinueScanmethods.
158-161: Good exception messaging with debugging context.Including both the parsed status and full response will help diagnose issues. Once the
FOUNDcheck (above) is fixed, this correctly handles genuinely unexpected responses likeERRORorUNKNOWN.
What does this PR do?
throw exception in case of unexpected response
#36
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.