From bc2e13786f3f118b24d673902ba3aa0f1a9a72df Mon Sep 17 00:00:00 2001 From: norohind <60548839+norohind@users.noreply.github.com> Date: Fri, 17 Dec 2021 00:44:33 +0300 Subject: [PATCH] More verbose on refresh fail --- capi/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/capi/__init__.py b/capi/__init__.py index 9c6bbb6..3650a99 100644 --- a/capi/__init__.py +++ b/capi/__init__.py @@ -163,7 +163,15 @@ class CAPIAuthorizer: except Exception as e: # probably here something don't work - logger.warning(f'Fail on refreshing token for {state!r}, row:{row}', exc_info=e) + text = '' + try: + text = refresh_request.text + + except Exception as e1: + text = f"can't get text because {e1}" + + logger.warning( + f'Fail on refreshing token for {state!r}, row:{row!r}, text: {text}', exc_info=e) msg['status'] = 'error' self.model.increment_refresh_tries(state)