Skip to content

Commit

Permalink
Merge pull request #73 from valefar-on-discord/error-catch-all
Browse files Browse the repository at this point in the history
Adding try/except when running cli to remove stack traces
  • Loading branch information
remyroy authored Jun 26, 2024
2 parents aa08b25 + f52ae00 commit 5b57b7b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ethstaker_deposit/deposit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from ethstaker_deposit.cli.exit_transaction_mnemonic import exit_transaction_mnemonic
from ethstaker_deposit.cli.generate_bls_to_execution_change import generate_bls_to_execution_change
from ethstaker_deposit.cli.new_mnemonic import new_mnemonic
from ethstaker_deposit.exceptions import ValidationError
from ethstaker_deposit.utils.click import (
captive_prompt_callback,
choice_prompt_func,
Expand Down Expand Up @@ -94,7 +95,12 @@ def cli(ctx: click.Context, language: str, non_interactive: bool, ignore_connect
def run() -> None:
freeze_support() # Needed when running under Windows in a frozen bundle
check_python_version()
cli()

try:
cli()
except (ValueError, ValidationError) as e:
click.echo(f"\nError: {e}\n", err=True)
sys.exit(1)


if __name__ == '__main__':
Expand Down

0 comments on commit 5b57b7b

Please sign in to comment.