Skip to content

Commit

Permalink
This fixes #59: json.decoder.JSONDecodeError: Expecting property name…
Browse files Browse the repository at this point in the history
… enclosed in double quotes if was broken
  • Loading branch information
Takashi Ando committed Jun 8, 2019
1 parent ae5b012 commit a67380c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mech/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ def instances():
except Timeout:
puts_err(colored.red(textwrap.fill("Couldn't access index, it seems locked.")))
sys.exit(1)
except json.decoder.JSONDecodeError:
puts_err(colored.red(textwrap.fill("Index file seems broken. Try to remove {}.".format(index_path))))
sys.exit(1)


def settle_instance(instance_name, obj=None, force=False):
Expand Down Expand Up @@ -222,6 +225,9 @@ def settle_instance(instance_name, obj=None, force=False):
except Timeout:
puts_err(colored.red(textwrap.fill("Couldn't access index, it seems locked.")))
sys.exit(1)
except json.decoder.JSONDecodeError:
puts_err(colored.red(textwrap.fill("Index file seems broken. Try to remove {}.".format(index_path))))
sys.exit(1)


def load_mechfile(pwd):
Expand Down

0 comments on commit a67380c

Please sign in to comment.