Skip to content

Commit

Permalink
Better exception output for problems with json output by plumed
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Aneurin Tribello authored and Gareth Aneurin Tribello committed May 10, 2024
1 parent a2f2193 commit 4e96519
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PlumedToHTML/PlumedToHTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ def get_html( inpt, name, outloc, tested, broken, plumedexe, actions=set({}) ) :
with open(name + '.json') as f :
try:
shortcutdata = json.load(f)
except ValueError as ve:
raise InvalidJSONError(ve)
except json.JSONDecodeError as ve:
raise Exception("invalid json for shortcut dictionary", ve)
# Put everything in to resolve the expansions. We call this function recursively just in case there are shortcuts in shortcuts
final_inpt = resolve_expansions( inpt, shortcutdata )
# Remove the tempory files that we created
Expand All @@ -203,8 +203,8 @@ def get_html( inpt, name, outloc, tested, broken, plumedexe, actions=set({}) ) :
with open('values_' + name + '.json') as f :
try:
valuedict = json.load(f)
except ValueError as ve:
raise InvalidJSONError(ve)
except json.JSONDecodeError as ve:
raise Exception("invalid json for value dictionary", ve)
# Remove the tempory files that we created
os.remove( 'values_' + name + ".json")
else : valuedict = {}
Expand Down

0 comments on commit 4e96519

Please sign in to comment.