IDS: rule downloader, catch UnicodeDecodeError and log.

This commit is contained in:
Ad Schellevis 2019-11-19 08:54:00 +01:00
parent 5f32b0788a
commit 10a3012520
1 changed files with 3 additions and 0 deletions

View File

@ -226,6 +226,9 @@ class Downloader(object):
except IOError:
syslog.syslog(syslog.LOG_ERR, 'cannot write to %s' % target_filename)
return None
except UnicodeDecodeError:
syslog.syslog(syslog.LOG_ERR, 'unable to read %s from %s (decode error)' % (target_filename, fetch_result['filename']))
return None
if not fetch_result['cached']:
syslog.syslog(syslog.LOG_NOTICE, 'download completed for %s' % frm_url)