Skip to content

Commit

Permalink
Throw meaningful error when proxy config file does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertLucian committed Jul 18, 2024
1 parent 2f0ac6f commit 233e3c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion aws-replicator/aws_replicator/client/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ def cmd_aws_proxy(services: str, config: str, container: bool, port: int, host:

config_json: ProxyConfig = {"services": {}}
if config:
config_json = yaml.load(load_file(config), Loader=yaml.SafeLoader)
loaded_file = load_file(config)
if not loaded_file:
console.print(f"Config file {config} does not exist")
sys.exit(1)
config_json = yaml.load(loaded_file, Loader=yaml.SafeLoader)
if host:
config_json["bind_host"] = host
if services:
Expand Down

0 comments on commit 233e3c2

Please sign in to comment.