allow file to be missing

This commit is contained in:
Wes Barnett 2021-04-15 20:13:04 -04:00
parent 98d4286157
commit e8a8c6c096
No known key found for this signature in database
GPG key ID: 1070BCC98C18BD66

View file

@ -150,7 +150,8 @@ class Prefile:
try:
pre_number = self.file.read_text()
except FileNotFoundError:
raise FileNotFoundError(f"prefile {self.file} not found. Ensure you have run the pre snapshot first.")
pre_number = None
logging.warning(f"prefile {self.file} not found. Ensure you have run the pre snapshot first.")
else:
self.file.unlink()
return pre_number