Skip to content

Commit d4ece25

Browse files
committed
Raise click exception where we don't need a full traceback
1 parent c4cd6ae commit d4ece25

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

planemo/galaxy/profiles.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import os
99
import shutil
1010

11+
import click
1112
from galaxy.util.commands import which
1213
from gxjobconfinit import (
1314
build_job_config,
@@ -56,7 +57,7 @@ def create_profile(ctx, profile_name, **kwds):
5657
profile_directory = _profile_directory(ctx, profile_name)
5758
if profile_exists(ctx, profile_name, **kwds):
5859
message = ALREADY_EXISTS_EXCEPTION % (profile_name, profile_directory)
59-
raise Exception(message)
60+
raise click.ClickException(message)
6061

6162
os.makedirs(profile_directory)
6263

@@ -177,7 +178,7 @@ def translate_alias(ctx, alias, profile_name):
177178

178179
def _load_profile_to_json(ctx, profile_name):
179180
if not profile_exists(ctx, profile_name):
180-
raise Exception("That profile does not exist. Create it with `planemo profile_create`")
181+
raise click.ClickException("That profile does not exist. Create it with `planemo profile_create`")
181182
profile_directory = _profile_directory(ctx, profile_name)
182183
profile_options_path = _stored_profile_options_path(profile_directory)
183184
with open(profile_options_path) as f:
@@ -234,7 +235,7 @@ def initialize_job_config(ctx, profile_name, **kwds):
234235
profile_directory = _profile_directory(ctx, profile_name)
235236
job_config_path = os.path.join(profile_directory, "job_conf.yml")
236237
if os.path.exists(job_config_path):
237-
raise Exception(f"File '{job_config_path}' already exists, exiting.")
238+
raise click.ClickException(f"File '{job_config_path}' already exists, exiting.")
238239

239240
init_config = ConfigArgs.from_dict(**kwds)
240241
job_config = build_job_config(init_config)

0 commit comments

Comments
 (0)