diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2008-11-18 22:31:12 -0500 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2008-11-18 22:31:12 -0500 |
commit | 7f34fb8f13cce5be52d5910ac86f81245e8d81d9 (patch) | |
tree | 75502a8de86d760782e7f9b494d6720a1255c2dd | |
parent | 4e3116c5762b2c0424ad68d5507df2e82d87b83c (diff) |
Try to catch failure when attaching a patch
If the response to attaching a patch doesn't have "Changes Submitted"
as the, assume the attachment failed and dump out an error message
and the response body.
-rwxr-xr-x | git-bz | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -571,7 +571,14 @@ class Bug(object): response_data = response.read() if response.status != 200: - die ("Failed to attach bug: %d" % response.status) + die ("Failed to attach patch to bug: status=%d" % response.status) + + # We hope that this is constant across bugzilla versions for a + # successful attachment + m = re.search(r"<title>\s*Changes\s+Submitted", response_data) + if not m: + print response_data + die ("Failed to attach patch to bug") print "Attached %s" % filename |