create UserError exception
Modules can raise this exception when they want to print errors to user
This commit is contained in:
parent
b4154b5843
commit
aea269e9f6
21 changed files with 68 additions and 47 deletions
|
|
@ -27,6 +27,7 @@ import urllib
|
|||
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword, BrowserUnavailable
|
||||
from weboob.tools.json import json
|
||||
|
||||
from weboob.capabilities.base import UserError
|
||||
from weboob.capabilities.chat import ChatException, ChatMessage
|
||||
from weboob.capabilities.messages import CantSendMessage
|
||||
|
||||
|
|
@ -34,7 +35,7 @@ from weboob.capabilities.messages import CantSendMessage
|
|||
__all__ = ['AuMBrowser']
|
||||
|
||||
|
||||
class AuMException(Exception):
|
||||
class AuMException(UserError):
|
||||
ERRORS = {"0.0.0": "Bad signature",
|
||||
"0.0.1": "Malformed request",
|
||||
"0.0.2": "Not logged",
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
import datetime
|
||||
import re
|
||||
|
||||
from weboob.capabilities import UserError
|
||||
from weboob.tools.capabilities.thumbnail import Thumbnail
|
||||
from weboob.tools.browser import BasePage, BrokenPageError
|
||||
|
||||
|
|
@ -69,7 +70,7 @@ class VideoPage(BasePage):
|
|||
def on_loaded(self):
|
||||
p = self.parser.select(self.document.getroot(), 'p.alert')
|
||||
if len(p) > 0:
|
||||
raise Exception(p[0].text)
|
||||
raise UserError(p[0].text)
|
||||
|
||||
def get_info_url(self):
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
from dateutil.parser import parse as parse_dt
|
||||
import urllib
|
||||
|
||||
from weboob.capabilities.base import NotAvailable
|
||||
from weboob.capabilities.base import NotAvailable, UserError
|
||||
from weboob.tools.capabilities.thumbnail import Thumbnail
|
||||
from weboob.tools.browser import BasePage, BrokenPageError
|
||||
from weboob.tools.misc import to_unicode
|
||||
|
|
@ -32,7 +32,7 @@ from ..video import NolifeTVVideo
|
|||
__all__ = ['VideoPage']
|
||||
|
||||
|
||||
class ForbiddenVideo(Exception):
|
||||
class ForbiddenVideo(UserError):
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
import datetime
|
||||
|
||||
from weboob.capabilities import UserError
|
||||
from weboob.tools.misc import to_unicode
|
||||
from weboob.tools.browser import BasePage, BrokenPageError
|
||||
|
||||
|
|
@ -26,7 +27,7 @@ from weboob.tools.browser import BasePage, BrokenPageError
|
|||
__all__ = ['StationNotFound', 'DeparturesPage']
|
||||
|
||||
|
||||
class StationNotFound(Exception):
|
||||
class StationNotFound(UserError):
|
||||
pass
|
||||
|
||||
class DeparturesPage(BasePage):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue