Skip to content

Commit

Permalink
Check if config file is JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
gabryelreyes committed Jun 26, 2024
1 parent 01d97c7 commit 3db615c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pyMetricCli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ def main() -> Ret:
LOG.info("* %s = %s", arg, vars(args)[arg])

try:
# Do something with the arguments.
LOG.info("Config file: %s", args.config_file)
if args.config_file.endswith(".json") is False:
raise ValueError(
"Invalid config_file format. Please provide a JSON file.")
except Exception as e: # pylint: disable=broad-except
LOG.error("An error occurred: %s", e)
ret_status = Ret.ERROR
Expand Down

0 comments on commit 3db615c

Please sign in to comment.