From 233e3c27aff0f88852bd28a0a5c5383a4d9feb27 Mon Sep 17 00:00:00 2001 From: Robert - Localstack Date: Thu, 18 Jul 2024 15:37:57 +0300 Subject: [PATCH] Throw meaningful error when proxy config file does not exist --- aws-replicator/aws_replicator/client/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aws-replicator/aws_replicator/client/cli.py b/aws-replicator/aws_replicator/client/cli.py index d199095..fdb443d 100644 --- a/aws-replicator/aws_replicator/client/cli.py +++ b/aws-replicator/aws_replicator/client/cli.py @@ -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: