Catch and handle httplib.BadStatusLine exception