Move HTTPWrongContentTypeException catch above Exception catch
This commit is contained in:
parent
ab0b3be741
commit
b1e40e8d4c
1 changed files with 2 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue