specifically handle HTTPWrongContentTypeException in title.py

This commit is contained in:
jesopo 2019-02-28 23:30:09 +00:00
parent 197ae2e053
commit 4467ba8ab6

View file

@ -13,6 +13,8 @@ class Module(ModuleManager.BaseModule):
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()