#1421 API filterResults returns Fault for API call which not returns list and non exist API call
Closed: Fixed by tkopecek. Opened by jcupova.

Steps to Reproduce:

Run filterResults('createTag', tag_name)

Actual result:

Fault: : createTag() did not return a list">

Expected result:

It should be GenericError.

Steps to Reproduce:

Run filterResults('nonExistAPI')

Actual result:

Fault: : 'RootExports' object has no attribute 'nonExistAPI'">

Expected result:

It should be GenericError.


Metadata Update from @tkopecek:
- Custom field Size adjusted to small
- Issue priority set to: Low (was: Normal)

Metadata Update from @dgregor:
- Issue set to the milestone: 1.21

We want to rise TypeError/AttributeError corresponding to docs. Problem is, that convertFault is ignoring standard exception and can reraise only koji ones. Question is, if we want to improve this behaviour and create koji.TypeError, koji.AttributeError, etc. and a) return these errors from convertFault or b) convert them to standard python exceptions there.

Caveat is, that there may be some code already handling Fault errors and "fixing" this could break them.

@mikem @julian8628 - opinions?

Auto-converting anything other than our internal exception classes sounds like a bad idea to me.

A hub call handler should not be deliberately raising TypeError, this is simply not sane.

I'm ok with making this a GenericError as Jana suggests (and changing the docstring correspondingly). At some point, it would be nice to refactor our exception hierarchy so that we don't just raise GenericError all the time, but for now most of the code does.

PR #2027

Metadata Update from @jcupova:
- Issue tagged with: testing-ready

Metadata Update from @jcupova:
- Issue untagged with: testing-ready

/missing second case/

Metadata Update from @tkopecek:
- Issue tagged with: testing-ready

Metadata Update from @jcupova:
- Issue tagged with: testing-done

Commit 26786174 fixes this issue

Commit 1f391a7e fixes this issue

Commit 1919ce80 fixes this issue

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/1421

Please continue any further discussion there.

Metadata
Related Pull Requests