Skip to content

Raise click exception where we don't need a full traceback#1577

Merged
mvdbeek merged 1 commit intogalaxyproject:masterfrom
mvdbeek:click_exception
Oct 15, 2025
Merged

Raise click exception where we don't need a full traceback#1577
mvdbeek merged 1 commit intogalaxyproject:masterfrom
mvdbeek:click_exception

Conversation

@mvdbeek
Copy link
Member

@mvdbeek mvdbeek commented Oct 15, 2025

No point in getting the whole traceback:

❯ planemo profile_create usegalaxy --engine external_galaxy --galaxy_url https://usegalaxy.org --galaxy_user_key $(gopass show accounts/usegalaxy.org/m.vandenbeek@gmail.com/api_key)
Traceback (most recent call last):
  File "/Users/mvandenb/src/planemo/.venv/bin/planemo", line 10, in <module>
    sys.exit(planemo())
             ~~~~~~~^^
  File "/Users/mvandenb/src/planemo/.venv/lib/python3.13/site-packages/click/core.py", line 1442, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/planemo/.venv/lib/python3.13/site-packages/click/core.py", line 1363, in main
    rv = self.invoke(ctx)
  File "/Users/mvandenb/src/planemo/.venv/lib/python3.13/site-packages/click/core.py", line 1830, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/mvandenb/src/planemo/.venv/lib/python3.13/site-packages/click/core.py", line 1226, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/planemo/.venv/lib/python3.13/site-packages/click/core.py", line 794, in invoke
    return callback(*args, **kwargs)
  File "/Users/mvandenb/src/planemo/.venv/lib/python3.13/site-packages/click/decorators.py", line 93, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/planemo/.venv/lib/python3.13/site-packages/click/core.py", line 794, in invoke
    return callback(*args, **kwargs)
  File "/Users/mvandenb/src/planemo/planemo/cli.py", line 103, in handle_blended_options
    return f(*args, **kwds)
  File "/Users/mvandenb/src/planemo/planemo/commands/cmd_profile_create.py", line 21, in cli
    profiles.create_profile(ctx, profile_name, **kwds)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/planemo/planemo/galaxy/profiles.py", line 59, in create_profile
    raise Exception(message)
Exception: Cannot create profile with name [usegalaxy], directory [/Users/mvandenb/.planemo/profiles/usegalaxy] already exists.

this is better:

❯ planemo profile_create usegalaxy --engine external_galaxy --galaxy_url https://usegalaxy.org --galaxy_user_key $(gopass show accounts/usegalaxy.org/m.vandenbeek@gmail.com/api_key)
Error: Cannot create profile with name [usegalaxy], directory [/Users/mvandenb/.planemo/profiles/usegalaxy] already exists.

@mvdbeek mvdbeek merged commit 451d138 into galaxyproject:master Oct 15, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants