From 895f96cbc687cbffd5f9b2b369ab7a06fd0c810d Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 12 Dec 2024 17:14:08 +0100 Subject: [PATCH] Improve error handling for GitHub App credentials by providing user feedback and exiting gracefully --- github_utility/github_cli/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/github_utility/github_cli/main.py b/github_utility/github_cli/main.py index b717337..3846f33 100644 --- a/github_utility/github_cli/main.py +++ b/github_utility/github_cli/main.py @@ -78,8 +78,9 @@ def get_github_acces_token( access_token = integration.get_access_token(installation.id).token typer.echo(f"{access_token}") else: - raise ValueError( - "Provide GitHub App credentials (app_id, private_key, and repo).") + typer.echo( + f"Provide GitHub App credentials (app_id, private_key, and repo).", err=True) + raise typer.Exit(code=1) @app.command("create-issue-from-file")