bito-code-review[bot] commented on code in PR #37185:
URL: https://github.com/apache/superset/pull/37185#discussion_r2853853644
##########
superset/mcp_service/chart/tool/get_chart_preview.py:
##########
@@ -2055,7 +2082,7 @@ async def get_chart_preview(
)
return result
- except Exception as e:
+ except (CommandException, SupersetException, ValueError, KeyError) as e:
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Inconsistent exception handling</b></div>
<div id="fix">
The change narrows exception handling from catching all exceptions to
specific types, which is inconsistent with other MCP tools (e.g.,
get_dataset_info.py, list_datasets.py) that use 'except Exception as e:' to
ensure graceful error responses. This may cause unexpected exceptions to bubble
up instead of returning a ChartError, potentially breaking the API contract.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
except Exception as e:
````
</div>
</details>
</div>
<small><i>Code Review Run #3ae4f8</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]