Move HTTPWrongContentTypeException catch above Exception catch

This commit is contained in:
jesopo 2019-03-01 23:29:07 +00:00
parent ab0b3be741
commit b1e40e8d4c

View file

@ -10,11 +10,11 @@ class Module(ModuleManager.BaseModule):
def _get_title(self, url):
try:
page = utils.http.request(url, soup=True)
except utils.http.HTTPWrongContentTypeException:
return None
except Exception as e:
self.log.error("failed to get URL title", [], exc_info=True)
return None
except utils.http.HTTPWrongContentTypeException:
return None
if page.data.title:
return page.data.title.text.replace("\n", " ").replace(
"\r", "").replace(" ", " ").strip()