Handle error on file listing API calls
This commit is contained in:
parent
cfce057783
commit
b2ea4c758d
1 changed files with 8 additions and 2 deletions
|
@ -642,11 +642,17 @@ class UiWebsocket(object):
|
||||||
|
|
||||||
# List files in directory
|
# List files in directory
|
||||||
def actionFileList(self, to, inner_path):
|
def actionFileList(self, to, inner_path):
|
||||||
return self.response(to, list(self.site.storage.walk(inner_path)))
|
try:
|
||||||
|
return list(self.site.storage.walk(inner_path))
|
||||||
|
except Exception as err:
|
||||||
|
return {"error": str(err)}
|
||||||
|
|
||||||
# List directories in a directory
|
# List directories in a directory
|
||||||
def actionDirList(self, to, inner_path):
|
def actionDirList(self, to, inner_path):
|
||||||
return self.response(to, list(self.site.storage.list(inner_path)))
|
try:
|
||||||
|
return list(self.site.storage.list(inner_path))
|
||||||
|
except Exception as err:
|
||||||
|
return {"error": str(err)}
|
||||||
|
|
||||||
# Sql query
|
# Sql query
|
||||||
def actionDbQuery(self, to, query, params=None, wait_for=None):
|
def actionDbQuery(self, to, query, params=None, wait_for=None):
|
||||||
|
|
Loading…
Reference in a new issue