betodealmeida commented on code in PR #29330:
URL: https://github.com/apache/superset/pull/29330#discussion_r1669494815
##########
superset/utils/core.py:
##########
@@ -432,7 +432,7 @@ def error_msg_from_exception(ex: Exception) -> str:
msg = ex.message.get("message") # type: ignore
elif ex.message:
msg = ex.message
- return msg or str(ex)
+ return str(msg) or str(ex)
Review Comment:
It might be clearer here do to early returns:
```python
if message := getattr(ex, "message", None):
if isinstance(message, dict) and message.get("message"):
return message["message"]
return message
return str(ex)
```
(I think this is equivalent.)
--
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]