betodealmeida commented on code in PR #40128:
URL: https://github.com/apache/superset/pull/40128#discussion_r3509488663
##########
superset/commands/dashboard/exceptions.py:
##########
@@ -70,6 +71,23 @@ class
DashboardColorsConfigUpdateFailedError(UpdateFailedError):
message = _("Dashboard color configuration could not be updated.")
+class DashboardRestoreFailedError(UpdateFailedError):
+ # Restore semantically clears ``deleted_at``; it is an UPDATE, not a new
+ # row. ``UpdateFailedError`` is the nearest typed middle-tier base in the
+ # codebase. A dedicated ``RestoreFailedError`` in
+ # ``superset/commands/exceptions.py`` would be more precise across the
+ # entity rollouts; extracting it there is left as a cross-entity follow-up.
+ message = _("Dashboard could not be restored.")
+
+
+class DashboardSlugConflictError(CommandException):
+ status = 422
+ message = _(
+ "Dashboard cannot be restored because its slug is now used by "
+ "another active dashboard. Rename one of the dashboards and retry."
Review Comment:
Love that this is actionable!
--
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]