Check response status and raise error.