handle GONE exception
This commit is contained in:
parent
5378f394dd
commit
5b993d06e0
1 changed files with 8 additions and 0 deletions
|
|
@ -21,6 +21,7 @@
|
||||||
import math
|
import math
|
||||||
import re
|
import re
|
||||||
import urllib
|
import urllib
|
||||||
|
import urllib2
|
||||||
|
|
||||||
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword, BrowserHTTPNotFound
|
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword, BrowserHTTPNotFound
|
||||||
from weboob.tools.json import json
|
from weboob.tools.json import json
|
||||||
|
|
@ -155,6 +156,13 @@ class AuMBrowser(BaseBrowser):
|
||||||
|
|
||||||
return r
|
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):
|
def home(self):
|
||||||
r = self.api_request('home/')
|
r = self.api_request('home/')
|
||||||
self.my_sex = r['user']['sex']
|
self.my_sex = r['user']['sex']
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue