handle GONE exception

This commit is contained in:
Romain Bignon 2013-02-19 16:52:06 +01:00
commit 5b993d06e0

View file

@ -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']