From c8da000aeb1c694c704325c4155b0731609ef015 Mon Sep 17 00:00:00 2001 From: Paul Farault Date: Mon, 15 Jul 2024 18:07:05 +0200 Subject: [PATCH] chore: remove catch group class --- tdp/cli/__main__.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tdp/cli/__main__.py b/tdp/cli/__main__.py index 0fb494b9..5d7af442 100644 --- a/tdp/cli/__main__.py +++ b/tdp/cli/__main__.py @@ -24,17 +24,6 @@ CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"]) -class CatchGroup(click.Group): - """Catch exceptions and print them to stderr.""" - - def __call__(self, *args, **kwargs): - try: - return self.main(*args, **kwargs) - - except Exception as e: - click.echo(f"Error: {e}", err=True) - - def load_env(ctx: click.Context, param: click.Parameter, value: Path) -> Optional[Path]: """Click callback to load the environment file.""" if value.exists(): @@ -44,7 +33,7 @@ def load_env(ctx: click.Context, param: click.Parameter, value: Path) -> Optiona logging.warning(f"Environment file {value} does not exist.") -@click.group("tdp", context_settings=CONTEXT_SETTINGS, cls=CatchGroup) +@click.group("tdp", context_settings=CONTEXT_SETTINGS) @click.option( "--env", default=".env",