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: 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()