openzim / python-libzim

Libzim binding for Python: read/write ZIM files in Python
https://pypi.org/project/libzim/
GNU General Public License v3.0
62 stars 20 forks source link

Use IndexError and KeyError on reader's get_article methods #54

Closed rgaudin closed 4 years ago

rgaudin commented 4 years ago

As C++ throws RuntimeError on incorrect URL or id when retrieving article, it is not the most practical nor pertinent choice. We then introduced NotFound on some of those queries. Raising KeyError on incorrect URL and IndexError on incorrect id makes more sense and have the benefit of being standard exceptions.