From eeb89e416176a2742d5ae344887b2a5e45fcd200 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 9 Apr 2018 22:04:16 +0200 Subject: [PATCH] Fix some weird behaviours when printing exceptions --- pyrogram/api/errors/error.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyrogram/api/errors/error.py b/pyrogram/api/errors/error.py index 05d3e36d..397af546 100644 --- a/pyrogram/api/errors/error.py +++ b/pyrogram/api/errors/error.py @@ -54,13 +54,13 @@ class Error(Exception): code = rpc_error.error_code if code not in exceptions: - raise UnknownError(rpc_error, query_type) + raise UnknownError(x=rpc_error, query_type=query_type) message = rpc_error.error_message id = re.sub(r"_\d+", "_X", message) if id not in exceptions[code]: - raise UnknownError(rpc_error, query_type) + raise UnknownError(x=rpc_error, query_type=query_type) x = re.search(r"_(\d+)", message) x = x.group(1) if x is not None else x @@ -68,7 +68,7 @@ class Error(Exception): raise getattr( import_module("pyrogram.api.errors"), exceptions[code][id] - )(x) + )(x=x) class UnknownError(Error):