Instead of just exploding with an ISE when the database hits a unique constraint we should return an error message that tells the user what field is not unique so they can fix it.
1) For any of the content-mgmt tools: When the database throws a unique constraint error we either display a plain-English explanation of what is required if the constraint is one that we have a plain-English explanation of, or the name of the constraint otherwise.
2) For any tools that have updated error handling code (currently just manage-channel): We display the data that the error was caused by.
3) For any of the content-mgmt tools (assuming version 0.8.3 or higher): If using a csv to upload data we display the line that the error occurred on.
Venkat, to test:
0) Install the newest rhn-content-mgmt version: https://brewweb.devel.redhat.com/buildinfo?buildID=150698
1) Get a baseline csv that you will modify: 'rhn-manage-channel-internal
--server dev --username <username> --password <password> --list
rhel-i386-server-5 > test.csv'
2) Change the label, try to create channel with that csv: 'rhn-manage-channel-internal --server dev --username <username> --password <password> --create --csv test.csv'
3) You should receive a unique constraint error about the name with the upgrades listed above.
4) Change the name, try again
5) You should receive a different unique constraint error with the upgrades listed above.
6) Similar things should happen for creating or updating channels, or for different tools altogether. Experiment and have fun.
Verified in dev.
both of them are giving
Unique Constraint Error:
Error Class Code: 23
Error Class Info: Could not update database entry.