Commit 06797c95 authored by Olivier Da Rocha's avatar Olivier Da Rocha Committed by ntome

[browser/exceptions] BrowserTooManyRequests: Add message parameter

This will prevent giving a message to BrowserTooManyRequests instead of
a next_try by mistake.
parent 5fe1786a
......@@ -54,7 +54,9 @@ class BrowserTooManyRequests(BrowserUnavailable):
# in exactly 24h
NEXT_24H = datetime.datetime.now() + relativedelta(days=1)
def __init__(self, next_try=None):
def __init__(self, message='', next_try=None):
super(BrowserTooManyRequests, self).__init__(message)
if next_try is None:
next_try = BrowserTooManyRequests.NEXT_24H
......@@ -64,4 +66,4 @@ class BrowserTooManyRequests(BrowserUnavailable):
self.next_try = next_try
def __str__(self):
return 'Too many requests, next_try set %s' % self.next_try
return super(BrowserTooManyRequests, self).__str__() or 'Too many requests, next_try set %s' % self.next_try
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment