From 29a4d58432270b50876b0d2cdf322d4e84fe82b5 Mon Sep 17 00:00:00 2001 From: SkyYang Date: Sat, 25 Apr 2020 20:40:30 +0800 Subject: [PATCH] [skip ci](shards): fix issue to show exception messages in error log (#2115) Signed-off-by: SkyYang --- shards/mishards/exceptions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shards/mishards/exceptions.py b/shards/mishards/exceptions.py index f254f6a6..662f4045 100644 --- a/shards/mishards/exceptions.py +++ b/shards/mishards/exceptions.py @@ -9,6 +9,11 @@ class BaseException(Exception): self.message = self.__class__.__name__ if not message else message self.metadata = metadata + def __repr__(self): + return self.message + + __str__ = __repr__ + class ConnectionConnectError(BaseException): code = codes.CONNECT_ERROR_CODE -- GitLab