Adds handling for errors after initial response.

Includes a test.