Skip to content

Commit

Permalink
better error messages for unknown jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
flupke committed Dec 4, 2017
1 parent a8acc2b commit 96e8ae0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions jenskipper/cli/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def wrapper(jobs_names, base_dir, **kwargs):
jobs_names = jobs_defs.keys()
unknown_jobs = set(jobs_names).difference(jobs_defs)
if unknown_jobs:
click.secho('Unknown jobs: %s' % ', '.join(unknown_jobs),
fg='red', bold=True)
sys.exit(1)
click.secho('Job(s) not found in repository: %s' %
', '.join(unknown_jobs), fg='red', bold=True)
sys.exit(4)

# Filter by dirty jobs
if dirty_flag and kwargs['use_dirty_jobs']:
Expand Down
2 changes: 1 addition & 1 deletion jenskipper/cli/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _print_job_status(base_dir, jenkins_url, job_name, status_only,
'/job/%s' % job_name)
except requests.HTTPError as exc:
if exc.response.status_code == 404:
utils.sechowrap('Unkown job: %s' % job_name)
utils.sechowrap('Job not found on Jenkins server: %s' % job_name)
exit_code = 2
else:
utils.sechowrap('Unexpected HTTP error %s while trying to '
Expand Down

0 comments on commit 96e8ae0

Please sign in to comment.