Adds handling for errors after initial response.

Includes a test.
Merge pull request #12 from drob/error-handling

Adds handling for errors after initial response.