I'm +1 here. I'm wondering (and we've had that discussion already somewhere) why we should wait with introducing new exceptions. If we just change GenericErrors to new ones we shouldn't break anything (older code will still catch GenericError descendants). And I think there was some good reason, Mike?
On Wed, Oct 20, 2021 at 6:27 PM Ken Dreyer ktdreyer@ktdreyer.com wrote:
Let's add more granular exceptions when resources do not exist.
Siege has written some client code that screen-scrapes faultStrings and puts those into more granular exceptions. Here's the list he's come up with. From https://obriencj.preoccupied.net/koji-smoky-dingo/kojismokydingo
NoSuchArchive NoSuchBuild NoSuchChannel NoSuchContentGenerator NoSuchPackage NoSuchPermission NoSuchRPM NoSuchRepo NoSuchTag NoSuchTarget NoSuchTask NoSuchUser
Since we assign numeric faultCodes sequentially as we add exceptions to Koji, it makes sense to me that we'd add these to koji in one go so they are ordered alphabetically.
The one I'm especially interested in is "NoSuchUser" for https://github.com/ktdreyer/koji-ansible/issues/221
I'm also wondering how long we have to wait to use these error classes on the hub, after we've shipped them in the main koji/__init__.py. _______________________________________________ koji-devel mailing list -- koji-devel@lists.fedorahosted.org To unsubscribe send an email to koji-devel-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/koji-devel@lists.fedorahosted.o... Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure