Skip to content

fix(admin) - centralize drop-failure error mapping and fix misleading messages#4793

Open
vigneshio wants to merge 1 commit into
apache:mainfrom
vigneshio:fix/admin-delete-error-messages
Open

fix(admin) - centralize drop-failure error mapping and fix misleading messages#4793
vigneshio wants to merge 1 commit into
apache:mainfrom
vigneshio:fix/admin-delete-error-messages

Conversation

@vigneshio

Copy link
Copy Markdown
Contributor

Summary

This change improves error messages when deleting catalogs, principals, and roles.

Previously, all delete failures were reported using messages meant for protected roles or admin roles, even when the real problem was something else. For example, if a normal principal like alice was deleted while being updated concurrently, the API could return:

"Root principal cannot be dropped, concurrent modification detected. Please try again"

That message incorrectly identifies alice as the root principal.

Now, each delete failure type returns a more accurate error:

  • Protected/root/admin entities keep their existing messages.
  • Concurrent modification errors mention the actual entity being modified.
  • Missing entities return a "not found" error.
  • Non-empty catalogs or namespaces return the appropriate "not empty" error.
  • Unknown failures return a generic message that includes the failure status.

Checklist

  • Don't disclose security issues! (contact security@apache.org)
  • Clearly explained why the changes are needed, or linked related issues.
  • Added/updated tests with good coverage, or manually tested (and explained how)
  • Added comments for complex logic
  • Updated CHANGELOG.md (if needed)
  • Updated documentation in site/content/in-dev/unreleased (if needed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant