Catch Missing File Error
This commit is contained in:
parent
90b6cb9cdf
commit
5e61fe8b06
1 changed files with 6 additions and 2 deletions
|
@ -388,8 +388,12 @@ class SiteStorage(object):
|
||||||
# Load and parse json file
|
# Load and parse json file
|
||||||
@thread_pool_fs_read.wrap
|
@thread_pool_fs_read.wrap
|
||||||
def loadJson(self, inner_path):
|
def loadJson(self, inner_path):
|
||||||
with self.open(inner_path, "r", encoding="utf8") as file:
|
try :
|
||||||
return json.load(file)
|
with self.open(inner_path) as file:
|
||||||
|
return json.load(file)
|
||||||
|
except Exception as err:
|
||||||
|
self.log.error("Json load error: %s" % Debug.formatException(err))
|
||||||
|
return None
|
||||||
|
|
||||||
# Write formatted json file
|
# Write formatted json file
|
||||||
def writeJson(self, inner_path, data):
|
def writeJson(self, inner_path, data):
|
||||||
|
|
Loading…
Reference in a new issue