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.
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. RaisingKeyError
on incorrect URL andIndexError
on incorrect id makes more sense and have the benefit of being standard exceptions.