mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
Show error messages on non-specialized error classes (closes #113)
This commit is contained in:
parent
92088383f7
commit
3fccfd40e6
|
@ -38,6 +38,10 @@ class ForbiddenError(RPCError):
|
|||
code = 403
|
||||
message = 'FORBIDDEN'
|
||||
|
||||
def __init__(self, message):
|
||||
super().__init__(self, message)
|
||||
self.message = message
|
||||
|
||||
|
||||
class NotFoundError(RPCError):
|
||||
"""
|
||||
|
@ -46,6 +50,10 @@ class NotFoundError(RPCError):
|
|||
code = 404
|
||||
message = 'NOT_FOUND'
|
||||
|
||||
def __init__(self, message):
|
||||
super().__init__(self, message)
|
||||
self.message = message
|
||||
|
||||
|
||||
class FloodError(RPCError):
|
||||
"""
|
||||
|
@ -67,6 +75,10 @@ class ServerError(RPCError):
|
|||
code = 500
|
||||
message = 'INTERNAL'
|
||||
|
||||
def __init__(self, message):
|
||||
super().__init__(self, message)
|
||||
self.message = message
|
||||
|
||||
|
||||
class BadMessageError(Exception):
|
||||
"""Occurs when handling a bad_message_notification"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user