bito-code-review[bot] commented on code in PR #38890:
URL: https://github.com/apache/superset/pull/38890#discussion_r3006768239


##########
superset/mcp_service/dashboard/tool/add_chart_to_existing_dashboard.py:
##########
@@ -534,7 +509,7 @@ def add_chart_to_existing_dashboard(
             error=None,
         )
 
-    except (CommandException, SQLAlchemyError, KeyError, ValueError) as e:
+    except Exception as e:

Review Comment:
   <!-- Bito Reply -->
   The update narrows the exception handling to specific types 
(CommandException, SQLAlchemyError, KeyError, ValueError), which aligns with 
the operations in the function: UpdateDashboardCommand can raise 
CommandException, database queries can raise SQLAlchemyError, and data access 
can raise KeyError/ValueError. This is more precise than catching Exception or 
the suggested (ValueError, KeyError, TypeError, AttributeError), avoiding 
unintended error suppression. Moving imports to the top level is also a good 
practice for clarity.



-- 
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]

Reply via email to