From 3ff8eef322e9481609106945db83cc5bfe5bd5d9 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Mon, 29 Nov 2021 12:11:10 -0500 Subject: [PATCH] add "NoSuch" custom exceptions Add more custom exception classes. This will allow to programmatically determine the error causes from complex RPCs. This commit simply defines the new classes and fault codes. Nothing in Koji's codebase uses these exceptions yet. We'll begin to raise these exceptions after this is widely deployed for clients in the field. --- koji/exceptions.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/koji/exceptions.py b/koji/exceptions.py index 67f2a080..d5f1537b 100644 --- a/koji/exceptions.py +++ b/koji/exceptions.py @@ -130,3 +130,51 @@ class LiveMediaError(GenericError): class GSSAPIAuthError(AuthError): """Raised when GSSAPI issue in authentication""" faultCode = 1023 + + +class NoSuchArchive(object): + faultCode = 1024 + + +class NoSuchBuild(object): + faultCode = 1025 + + +class NoSuchChannel(object): + faultCode = 1026 + + +class NoSuchContentGenerator(object): + faultCode = 1027 + + +class NoSuchPackage(object): + faultCode = 1028 + + +class NoSuchPermission(object): + faultCode = 1029 + + +class NoSuchRPM(object): + faultCode = 1030 + + +class NoSuchRepo(object): + faultCode = 1031 + + +class NoSuchTag(object): + faultCode = 1032 + + +class NoSuchTarget(object): + faultCode = 1033 + + +class NoSuchTask(object): + faultCode = 1034 + + +class NoSuchUser(object): + faultCode = 1035