From 7a5e1fbbccba5bdfb655c816953e9fe506c6475e Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Apr 15 2020 11:08:54 +0000 Subject: translate exceptions to GenericError Fixes: https://pagure.io/koji/issue/2067 --- diff --git a/hub/kojihub.py b/hub/kojihub.py index 80dd6d3..d829577 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -12506,7 +12506,11 @@ class RootExports(object): method = getattr(self, methodName) except AttributeError: raise koji.GenericError("method %s doesn't exist" % methodName) - results = method(*args, **kw) + try: + results = method(*args, **kw) + except Exception as ex: + raise koji.GenericError("method %s raised an exception (%s)" % (methodName, str(ex))) + if results is None: return 0, None elif isinstance(results, list):