dkpro / dkpro-cassis

UIMA CAS processing library written in Python
https://pypi.org/project/dkpro-cassis/
Apache License 2.0
84 stars 22 forks source link

Better error message when failing to resolve feature path #183

Closed reckart closed 2 years ago

reckart commented 2 years ago

Describe the bug When trying to access a feature/feature path on an FS that does not exist, the error is an AttributeError with a not very helpful error message.

To Reproduce

def test_bad_feature_path(small_typesystem_xml):
    cas = Cas(typesystem=load_typesystem(small_typesystem_xml))
    TokenType = cas.typesystem.get_type("cassis.Token")
    token = TokenType(xmiID=10, begin=0, end=0)

    with pytest.raises(AttributeError) as ex:
        token[0]

Expected behavior A nicer error message would be good

Please complete the following information: