From 71bead595502b96439d627b2a48fc17d40458e36 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Thu, 4 Jan 2024 11:37:25 -0500 Subject: [PATCH] make error a bit clearer --- kojihub/kojihub.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kojihub/kojihub.py b/kojihub/kojihub.py index 82f0a3c2..c2d7105d 100644 --- a/kojihub/kojihub.py +++ b/kojihub/kojihub.py @@ -6119,8 +6119,11 @@ def new_build(data, strict=False): # check for existing build old_binfo = get_build(data) if old_binfo: - if strict or data['draft']: - raise koji.GenericError(f'Existing build found: {old_binfo}') + old_str = '%(nvr)s (id=%(id)s)' % old_binfo + if data['draft']: + raise koji.GenericError(f'Target build already exists: {old_str}') + elif strict: + raise koji.GenericError(f'Existing build found: {old_str}') recycle_build(old_binfo, data) # Raises exception if there is a problem return old_binfo['id']