lib. Something like know the exact response number (200, 404 etc) withoutPython libraries usually throw exceptions to indicate error conditions.
the above block.
If this is a problem in your app then can write a wrapper function
which captures the HTTPError exception, extracts the code, and returns
it to the caller.
David.