PR#2150: translate exceptions to GenericError
Merges #2150 https://pagure.io/koji/pull-request/2150 Fixes: #2067 https://pagure.io/koji/issue/2067 API filterResults returns Fault for API call with unexpected keyword
This commit is contained in:
commit
8f3885ce23
1 changed files with 5 additions and 1 deletions
|
|
@ -12539,7 +12539,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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue