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


##########
superset/explore/api.py:
##########
@@ -135,7 +135,11 @@ def get(self) -> Response:
             return self.response(404, message=str(ex))
         except WrongEndpointError as ex:
             return self.response(302, redirect=ex.redirect)
-        except TemporaryCacheAccessDeniedError as ex:
-            return self.response(403, message=str(ex))
+        except TemporaryCacheAccessDeniedError:
+            return self.response(
+                403,
+                message="You do not have permission to access this datasource",
+                extra={"is_access_denial": True},
+            )

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing i18n wrapper on error message</b></div>
   <div id="fix">
   
   Hardcoded English error string skips i18n. Wrap in `_("...")` and import 
`from flask_babel import _` (precedent in `superset/charts/data/api.py` lines 
172/232/322/336/430). Non-English users see untranslated text via the REST 
error response.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #bc661e</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]

Reply via email to