From 5b993d06e0a823f005a94502e35e48465865766a Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Tue, 19 Feb 2013 16:52:06 +0100 Subject: [PATCH] handle GONE exception --- modules/aum/browser.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/aum/browser.py b/modules/aum/browser.py index a296978a..48189bc8 100644 --- a/modules/aum/browser.py +++ b/modules/aum/browser.py @@ -21,6 +21,7 @@ import math import re import urllib +import urllib2 from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword, BrowserHTTPNotFound from weboob.tools.json import json @@ -155,6 +156,13 @@ class AuMBrowser(BaseBrowser): return r + def get_exception(self, e): + if isinstance(e, urllib2.HTTPError) and hasattr(e, 'getcode'): + if e.getcode() in (410,): + return BrowserHTTPNotFound + + return BaseBrowser.get_exception(self, e) + def home(self): r = self.api_request('home/') self.my_sex = r['user']['sex']