use UserError instead of ValueError

This commit is contained in:
Alexandre Morignot 2015-02-08 16:32:02 +01:00
commit fec392699b
2 changed files with 4 additions and 2 deletions

View file

@ -19,6 +19,7 @@
from weboob.browser import PagesBrowser, URL
from weboob.capabilities.base import UserError
from .pages.index import IndexPage
from .pages.video import VideoPage
@ -45,7 +46,7 @@ class YoujizzBrowser(PagesBrowser):
def search_videos(self, pattern):
if len(pattern) < 3:
raise ValueError('Pattern to short (min length : 3 characters)')
raise UserError('Pattern to short (min length : 3 characters)')
self.search.go(pattern=pattern, pagenum=1)
assert self.search.is_here(pattern=pattern, pagenum=1)