Skip to content

Commit c57e0bb

Browse files
committed
cli: Drop explicit ProtocolError handling
Not sure what prompted the original redirect suggestion, but I can't find a reproducer, so just wrap it into our connection fail
1 parent 2142584 commit c57e0bb

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

bugzilla/_cli.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,13 +1142,6 @@ def main(unittest_bz_instance=None):
11421142
except (Fault, bugzilla.BugzillaError) as e:
11431143
print("\nServer error: %s" % str(e))
11441144
sys.exit(3)
1145-
except ProtocolError as e:
1146-
print("\nInvalid server response: %d %s" % (e.errcode, e.errmsg))
1147-
redir = (e.headers and 'location' in e.headers)
1148-
if redir:
1149-
print("\nServer was attempting a redirect. Try: "
1150-
" bugzilla --bugzilla %s ..." % redir)
1151-
sys.exit(4)
11521145
except requests.exceptions.SSLError as e:
11531146
# Give SSL recommendations
11541147
print("SSL error: %s" % e)
@@ -1158,10 +1151,12 @@ def main(unittest_bz_instance=None):
11581151
sys.exit(4)
11591152
except (socket.error,
11601153
requests.exceptions.HTTPError,
1161-
requests.exceptions.ConnectionError) as e:
1154+
requests.exceptions.ConnectionError,
1155+
ProtocolError) as e:
11621156
print("\nConnection lost/failed: %s" % str(e))
11631157
sys.exit(2)
11641158

1159+
11651160
def cli():
11661161
try:
11671162
main()

0 commit comments

Comments
 (0)