The base attribute cannot be deleted without deleting its sub attributes if present.
Steps to reproduce:
- Go to /admin/attributes and pick any attribute
- Create two attributes, one as the base and other as the child to the first
- Try to delete the base attribute and you'll get the error after you agree to delete
If the error is expected, the error should be more friendly and tell something like "Remove the sub attribute before removing the base attribute"