From ee2d5b1315633629974275101c9c2b56f8d80c18 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 9 Jul 2019 19:03:37 +0200 Subject: [PATCH] Fix RPCError raising an error itself because of non-optional args --- pyrogram/errors/rpc_error.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyrogram/errors/rpc_error.py b/pyrogram/errors/rpc_error.py index e0acdc21..806b5373 100644 --- a/pyrogram/errors/rpc_error.py +++ b/pyrogram/errors/rpc_error.py @@ -32,12 +32,12 @@ class RPCError(Exception): NAME = None MESSAGE = "{x}" - def __init__(self, x: int or RawRPCError, rpc_name: str, is_unknown: bool): - super().__init__("[{} {}]: {} ({})".format( + def __init__(self, x: int or RawRPCError = None, rpc_name: str = None, is_unknown: bool = False): + super().__init__("[{} {}]: {} {}".format( self.CODE, self.ID or self.NAME, self.MESSAGE.format(x=x), - 'caused by "{}"'.format(rpc_name) + '(caused by "{}")'.format(rpc_name) if rpc_name else "" )) try: