bito-code-review[bot] commented on code in PR #37859:
URL: https://github.com/apache/superset/pull/37859#discussion_r2790162890
##########
superset/mcp_service/middleware.py:
##########
@@ -115,16 +117,76 @@ async def on_message(
user_id = get_user_id()
except Exception:
user_id = None
Review Comment:
<!-- Bito Reply -->
The fix in middleware.py replaces the broad `except Exception` with `except
(RuntimeError, AttributeError)`, matching the specific exceptions
`get_user_id()` can throw. This avoids catching unintended errors, improving
robustness.
**superset/mcp_service/middleware.py**
```
try:
user_id = get_user_id()
except (RuntimeError, AttributeError):
user_id = None
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]