aboutsummaryrefslogtreecommitdiff
path: root/modules/title.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-03-01 23:29:07 +0000
committerGravatar jesopo2019-03-01 23:29:07 +0000
commitb1e40e8d4c60e0c7293281068a6cfa5b3037e32e (patch)
tree5baefcdf6e79b00f7ec5bebf9109c8b6fa9bb02c /modules/title.py
parent`event` doesn't have a `"channel"` in an API hook (diff)
signature
Move HTTPWrongContentTypeException catch above Exception catch
Diffstat (limited to 'modules/title.py')
-rw-r--r--modules/title.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/title.py b/modules/title.py
index b3d2fd85..d06ec24d 100644
--- a/modules/title.py
+++ b/modules/title.py
@@ -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()