From a6212b636556a166147eacc5871adb3ef75728bd Mon Sep 17 00:00:00 2001 From: Jesse Date: Wed, 29 May 2024 05:18:51 -0400 Subject: [PATCH] Fix log error in oauth.py (#269) * Duplicate of applicable change from #93 Signed-off-by: Jesse Whitehouse * Update changelog Signed-off-by: Jesse Whitehouse * Fix after merge Signed-off-by: Levko Kravets --------- Signed-off-by: Jesse Whitehouse Signed-off-by: Levko Kravets Co-authored-by: Levko Kravets --- CHANGELOG.md | 4 ++++ src/databricks/sql/auth/oauth.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16462554..1e0b34bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +# (Unreleased) + +- Fix: our logger would raise an uncaught exception under certain oauth error conditions + # 3.1.2 (2024-04-18) - Remove broken cookie code (#379) diff --git a/src/databricks/sql/auth/oauth.py b/src/databricks/sql/auth/oauth.py index 78f516fe..806df08f 100644 --- a/src/databricks/sql/auth/oauth.py +++ b/src/databricks/sql/auth/oauth.py @@ -125,7 +125,7 @@ def __get_authorization_code(self, client, auth_url, scope, state, challenge): logger.info(f"Port {port} is in use") last_error = e except Exception as e: - logger.error("unexpected error", e) + logger.error("unexpected error: %s", e) if self.redirect_port is None: logger.error( f"Tried all the ports {self.port_range} for oauth redirect, but can't find free port"