Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw meaningful error when proxy config file does not exist #76

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RobertLucian
Copy link
Contributor

No description provided.

@RobertLucian RobertLucian added the bug Something isn't working label Jul 18, 2024
@RobertLucian RobertLucian requested a review from whummer July 18, 2024 12:38
@RobertLucian RobertLucian self-assigned this Jul 18, 2024
loaded_file = load_file(config)
if not loaded_file:
console.print(f"Config file {config} does not exist")
sys.exit(1)
Copy link
Member

@whummer whummer Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Probably better to use Context.exit here, so click can run any cleanup/shutdown logic, if any.

...
@click.pass_context
def cmd_aws_proxy(context, services: str, config: str, container: bool, port: int, host: str):
    from aws_replicator.client.auth_proxy import start_aws_auth_proxy_in_container
    
    if ...:
        ...
        context.exit(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants