Skip to content

Commit

Permalink
error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Nov 14, 2024
1 parent 7ae3425 commit 179e50b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ovos_workshop/resource_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,11 @@ def load(self):
class JsonFile(ResourceFile):
def load(self) -> Dict[str, Any]:
if self.file_path is not None:
with open(self.file_path) as f:
return json.load(f)
try:
with open(self.file_path) as f:
return json.load(f)
except Exception as e:
LOG.error(f"Failed to load {self.file_path}: {e}")
return {}


Expand Down

0 comments on commit 179e50b

Please sign in to comment.