Vitor-Avila commented on code in PR #32231:
URL: https://github.com/apache/superset/pull/32231#discussion_r1958838887
##########
superset/commands/database/exceptions.py:
##########
@@ -88,11 +88,21 @@ def __init__(self, key: str = "") -> None:
)
+class DatabaseConnectionResyncPermissionsError(CommandException):
+ status = 500
+ message = _("Unable to resync permissions for this database connection.")
+
+
class DatabaseNotFoundError(CommandException):
status = 404
message = _("Database not found.")
+class UserNotFoundError(CommandException):
+ status = 400
Review Comment:
I initially set this as `400`, thinking of a bad payload (this is for a
Database API, not interacting directly with User objects). However, the user is
not really passed via payload/parameter, and instead is retrieved from the
session. I updated this exception to `UserNotFoundInSessionError` and set its
status to `500` (since this is handled by the app internally).
Let me know if you have any concerns with this change! 🙏
--
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]