Completely change errors (make one class for each)

This commit is contained in:
Lonami Exo
2017-06-10 11:47:51 +02:00
parent 5df4716164
commit 44ab85962b
13 changed files with 763 additions and 323 deletions

View File

@@ -0,0 +1,16 @@
from . import FloodError
class FloodWaitError(FloodError):
def __init__(self, **kwargs):
self.seconds = kwargs['extra']
super(Exception, self).__init__(
self,
'A wait of {} seconds is required.'
.format(self.seconds)
)
rpc_420_errors = {
'FLOOD_WAIT_(\d+)': FloodWaitError
}