Improved error message for connect error to clamav daemon.

This commit is contained in:
Bastian Kleineidam 2012-03-12 21:13:22 +01:00
parent 5e13a78f66
commit 5c542277af
2 changed files with 7 additions and 1 deletions

View file

@ -8,6 +8,8 @@ Fixes:
Closes: SF bug #3495621
- checking: Fix non-ascii HTTP header debugging.
Closes: SF bug #3488675
- checking: Improved error message for connect errors to the ClamAV
virus checking daemon.
7.5 "Kukushka" (released 13.02.2012)

View file

@ -187,7 +187,11 @@ def scan (data):
@rtype ([], [])
"""
clamconf = ClamavConfig(canonical_clamav_conf())
scanner = ClamdScanner(clamconf)
try:
scanner = ClamdScanner(clamconf)
except socket.error:
errmsg = _("Could not connect to ClamAV daemon.")
return ([], [errmsg])
try:
scanner.scan(data)
finally: