diff options
| author | 2019-03-01 23:29:07 +0000 | |
|---|---|---|
| committer | 2019-03-01 23:29:07 +0000 | |
| commit | b1e40e8d4c60e0c7293281068a6cfa5b3037e32e (patch) | |
| tree | 5baefcdf6e79b00f7ec5bebf9109c8b6fa9bb02c | |
| parent | `event` doesn't have a `"channel"` in an API hook (diff) | |
| signature | ||
Move HTTPWrongContentTypeException catch above Exception catch
| -rw-r--r-- | modules/title.py | 4 |
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() |
