Handled value error

This commit is contained in:
giuliof 2021-09-04 11:20:53 +02:00
parent df82337f1f
commit 6c20ea6d0f
1 changed files with 4 additions and 2 deletions

View File

@ -64,7 +64,10 @@ try:
# Retrieve last database update timestamp
luh = open(glob.conf['default']['outdir'] + '/lastupdate.txt', 'r')
lu = int(float(luh.read()))
try:
lu = int(float(luh.read()))
except ValueError:
lu = 0
luh.close()
logging.info("last database update timestamp is %d" % lu)
@ -103,7 +106,6 @@ try:
# Get a Python-friendly library struct from XML file
library = tcparser.getLibrary(cachefile, lu)
# TODO: properly handle missing file errors or things like this
### Get filters to search for books ###
try: