Skip to content
Snippets Groups Projects
Commit 64fc1306 authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

Launcher script: added a catch for json decode errors

parent be94de35
No related branches found
No related tags found
No related merge requests found
...@@ -17,8 +17,12 @@ class ErrorCodes(Enum): ...@@ -17,8 +17,12 @@ class ErrorCodes(Enum):
# Class representing the VA-Launcher config (.json) file # Class representing the VA-Launcher config (.json) file
class LauncherConfig: class LauncherConfig:
def __init__(conf, sConfigFile): def __init__(conf, sConfigFile):
try:
with open( sConfigFile ) as json_file: with open( sConfigFile ) as json_file:
json_config = json.load(json_file) json_config = json.load(json_file)
except Exception as e:
print( "ERROR reading the json config:" + os.linesep + str(e) )
sys.exit( ErrorCodes.ERROR_INCOMPLETE_CONFIG )
try: try:
conf.dVirtualAcousticDirectories = json_config["dVAServerDirectories"] conf.dVirtualAcousticDirectories = json_config["dVAServerDirectories"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment