From 325d6acc60e881eb51d6cff740ed2a7cc7d173de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Brand=C3=A3o?= <555migalves555@gmail.com> Date: Tue, 8 Aug 2023 11:07:30 +0100 Subject: [PATCH 1/3] raised some exceptions that were allowed to follow trough and some prints to typer.echo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miguel Brandão <555migalves555@gmail.com> --- deepsearch/cps/cli/data_indices_typer.py | 2 +- deepsearch/cps/cli/projects.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deepsearch/cps/cli/data_indices_typer.py b/deepsearch/cps/cli/data_indices_typer.py index ade0f569..656bcf68 100644 --- a/deepsearch/cps/cli/data_indices_typer.py +++ b/deepsearch/cps/cli/data_indices_typer.py @@ -55,7 +55,7 @@ def list( for index in indices ] except ValueError as e: - print(f"Error occurred: {e}") + raise typer.Abort() cli_output(results, output, headers="keys") return diff --git a/deepsearch/cps/cli/projects.py b/deepsearch/cps/cli/projects.py index 7b0e6eb7..e82c3903 100644 --- a/deepsearch/cps/cli/projects.py +++ b/deepsearch/cps/cli/projects.py @@ -49,7 +49,7 @@ def assign_user( role=role, ) else: - print("Project not found") + typer.echo("Project not found") raise typer.Exit(code=1) @@ -63,7 +63,7 @@ def remove( if project is not None: api.projects.remove(project=project) else: - print("Project not found") + typer.echo("Project not found") raise typer.Exit(code=1) From 25d63f58fad2441a84c3c076c156ccfd60e168b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Brand=C3=A3o?= <555migalves555@gmail.com> Date: Fri, 11 Aug 2023 13:15:03 +0100 Subject: [PATCH 2/3] added error printout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miguel Brandão <555migalves555@gmail.com> --- deepsearch/cps/cli/data_indices_typer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deepsearch/cps/cli/data_indices_typer.py b/deepsearch/cps/cli/data_indices_typer.py index 656bcf68..ca7a8e5a 100644 --- a/deepsearch/cps/cli/data_indices_typer.py +++ b/deepsearch/cps/cli/data_indices_typer.py @@ -55,6 +55,8 @@ def list( for index in indices ] except ValueError as e: + typer.echo(f"Error occurred: {e}") + typer.echo(ERROR_MSG) raise typer.Abort() cli_output(results, output, headers="keys") From 5d776234bb6a34206eacc0e1d6b8245a8c097389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Brand=C3=A3o?= <555migalves555@gmail.com> Date: Fri, 11 Aug 2023 13:34:51 +0100 Subject: [PATCH 3/3] changes from review aug\11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miguel Brandão <555migalves555@gmail.com> --- deepsearch/cps/cli/data_indices_typer.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/deepsearch/cps/cli/data_indices_typer.py b/deepsearch/cps/cli/data_indices_typer.py index ca7a8e5a..552b2a93 100644 --- a/deepsearch/cps/cli/data_indices_typer.py +++ b/deepsearch/cps/cli/data_indices_typer.py @@ -55,9 +55,7 @@ def list( for index in indices ] except ValueError as e: - typer.echo(f"Error occurred: {e}") - typer.echo(ERROR_MSG) - raise typer.Abort() + raise RuntimeError("Could not parse index object") from e cli_output(results, output, headers="keys") return