log when json file does not exist
This commit is contained in:
1 parent
909a1a48e5
commit
eccc25b373
1 file changed
+7
-1
@@ -41,10 +41,16 @@ class BufferedJSON:
|
||||
return {}
|
||||
return json_load(self.fname, *args, **kwargs)
|
||||
|
||||
|
||||
def exists(self):
|
||||
if not self.fname:
|
||||
log.warning("filename not given")
|
||||
return False
|
||||
return os.path.exists(self.fname)
|
||||
|
||||
res = os.path.exists(self.fname)
|
||||
if not res:
|
||||
log.warning(f"{self.fname} does not exist")
|
||||
return res
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user