Skip to content

Commit

Permalink
fix/exception-in-console
Browse files Browse the repository at this point in the history
  • Loading branch information
sankarngrjn committed Nov 25, 2024
1 parent 6c31320 commit 0fa7a62
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rich_click/rich_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ def main(
if not standalone_mode:
raise
if ctx is not None:
config = ctx.help_config
formatter = ctx.make_formatter()
else:
config = self._generate_rich_help_config()
formatter = self.context_class.formatter_class(config=config, file=sys.stderr)
formatter = self.context_class.formatter_class(config=config, file=sys.stderr)
from rich_click.rich_help_rendering import rich_format_error

rich_format_error(e, formatter)
Expand All @@ -192,10 +192,10 @@ def main(
raise
try:
if ctx is not None:
config = ctx.help_config
formatter = ctx.make_formatter()
else:
config = self._generate_rich_help_config()
formatter = self.context_class.formatter_class(config=config)
formatter = self.context_class.formatter_class(config=config)
except Exception:
click.echo("Aborted!", file=sys.stderr)
else:
Expand Down

0 comments on commit 0fa7a62

Please sign in to comment.