Ignore not existent files on dbdict items
This commit is contained in:
parent
9fd19bf382
commit
ca2a30f7ae
1 changed files with 6 additions and 8 deletions
|
@ -25,7 +25,7 @@ class ContentDbDict(dict):
|
||||||
content = self.site.storage.loadJson(key)
|
content = self.site.storage.loadJson(key)
|
||||||
dict.__setitem__(self, key, content)
|
dict.__setitem__(self, key, content)
|
||||||
except IOError:
|
except IOError:
|
||||||
dict.__delitem__(self, key) # File not exists anymore
|
self.__delitem__(key) # File not exists anymore
|
||||||
raise KeyError(key)
|
raise KeyError(key)
|
||||||
|
|
||||||
self.addCachedKey(key)
|
self.addCachedKey(key)
|
||||||
|
@ -81,13 +81,11 @@ class ContentDbDict(dict):
|
||||||
def items(self):
|
def items(self):
|
||||||
back = []
|
back = []
|
||||||
for key in dict.keys(self):
|
for key in dict.keys(self):
|
||||||
val = self[key]
|
try:
|
||||||
if not val:
|
val = self[key]
|
||||||
try:
|
except Exception:
|
||||||
val = self.loadItem(key)
|
self.log.error("Error loading %s: %s" % (key, err))
|
||||||
except Exception:
|
continue
|
||||||
self.log.error("Error loading %s: %s" % (key, err))
|
|
||||||
continue
|
|
||||||
back.append((key, val))
|
back.append((key, val))
|
||||||
return back
|
return back
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue