specifically handle HTTPWrongContentTypeException in title.py
This commit is contained in:
parent
197ae2e053
commit
4467ba8ab6
1 changed files with 2 additions and 0 deletions
|
@ -13,6 +13,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.log.error("failed to get URL title", [], exc_info=True)
|
self.log.error("failed to get URL title", [], exc_info=True)
|
||||||
return None
|
return None
|
||||||
|
except utils.http.HTTPWrongContentTypeException:
|
||||||
|
return None
|
||||||
if page.data.title:
|
if page.data.title:
|
||||||
return page.data.title.text.replace("\n", " ").replace(
|
return page.data.title.text.replace("\n", " ").replace(
|
||||||
"\r", "").replace(" ", " ").strip()
|
"\r", "").replace(" ", " ").strip()
|
||||||
|
|
Loading…
Reference in a new issue