You need to check the status and raise an appropriate exception if it's not 200.