From 71bead595502b96439d627b2a48fc17d40458e36 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Jan 05 2024 10:00:59 +0000 Subject: make error a bit clearer --- diff --git a/kojihub/kojihub.py b/kojihub/kojihub.py index 82f0a3c..c2d7105 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']