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

Steps to Reproduce:

Run filterResults('createTag', tag_name)

Actual result:

Fault: <Fault 1: "<class 'TypeError'>: createTag() did not return a list">

Expected result:

It should be GenericError.

Steps to Reproduce:

Run filterResults('nonExistAPI')

Actual result:

Fault: <Fault 1: "<class 'AttributeError'>: '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)

4 years ago

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

4 years ago

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.

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

4 years ago

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

4 years ago

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

4 years ago

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

4 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #2027 Merged 4 years ago