|
8 | 8 | import os |
9 | 9 | import shutil |
10 | 10 |
|
| 11 | +import click |
11 | 12 | from galaxy.util.commands import which |
12 | 13 | from gxjobconfinit import ( |
13 | 14 | build_job_config, |
@@ -56,7 +57,7 @@ def create_profile(ctx, profile_name, **kwds): |
56 | 57 | profile_directory = _profile_directory(ctx, profile_name) |
57 | 58 | if profile_exists(ctx, profile_name, **kwds): |
58 | 59 | message = ALREADY_EXISTS_EXCEPTION % (profile_name, profile_directory) |
59 | | - raise Exception(message) |
| 60 | + raise click.ClickException(message) |
60 | 61 |
|
61 | 62 | os.makedirs(profile_directory) |
62 | 63 |
|
@@ -177,7 +178,7 @@ def translate_alias(ctx, alias, profile_name): |
177 | 178 |
|
178 | 179 | def _load_profile_to_json(ctx, profile_name): |
179 | 180 | 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`") |
181 | 182 | profile_directory = _profile_directory(ctx, profile_name) |
182 | 183 | profile_options_path = _stored_profile_options_path(profile_directory) |
183 | 184 | with open(profile_options_path) as f: |
@@ -234,7 +235,7 @@ def initialize_job_config(ctx, profile_name, **kwds): |
234 | 235 | profile_directory = _profile_directory(ctx, profile_name) |
235 | 236 | job_config_path = os.path.join(profile_directory, "job_conf.yml") |
236 | 237 | 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.") |
238 | 239 |
|
239 | 240 | init_config = ConfigArgs.from_dict(**kwds) |
240 | 241 | job_config = build_job_config(init_config) |
|
0 commit comments