From 2c780803768f175a238a68f7cea053da539bbb33 Mon Sep 17 00:00:00 2001 From: Sean McIntyre Date: Sun, 15 Aug 2021 23:05:06 -0400 Subject: [PATCH] python3 errors should convert to strings via str() rather than e.message (#34) --- twirp/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twirp/client.py b/twirp/client.py index efb9bfb..7f81238 100644 --- a/twirp/client.py +++ b/twirp/client.py @@ -28,12 +28,12 @@ def _make_request(self, *args, url, ctx, request, response_obj, **kwargs): except requests.exceptions.Timeout as e: raise exceptions.TwirpServerException( code=errors.Errors.DeadlineExceeded, - message=e.message, + message=str(e), meta={"original_exception": e}, ) except requests.exceptions.ConnectionError as e: raise exceptions.TwirpServerException( code=errors.Errors.Unavailable, - message=e.message, + message=str(e), meta={"original_exception": e}, )