Skip to content

Commit fbdb5dc

Browse files
ai: apply changes for #876 (1 review thread)
Addresses: - #3636506949 at src/databricks/sql/auth/oauth.py:246 Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
1 parent 91e698e commit fbdb5dc

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/databricks/sql/auth/oauth.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,13 @@ def _on_timeout():
247247
logger.error(msg)
248248
raise RuntimeError(msg) from e
249249
except Exception as e:
250+
# Record here too (like the OSError branch above) so the
251+
# fall-through `raise last_error` always re-raises a real
252+
# exception. If a non-OSError/non-webbrowser.Error is raised on
253+
# every port, last_error would otherwise stay None and turn
254+
# `raise last_error` into `raise None`, masking the real failure
255+
# with a confusing TypeError.
256+
last_error = e
250257
logger.error("unexpected error: %s", e)
251258
if self.redirect_port is None:
252259
logger.error(

0 commit comments

Comments
 (0)