Fix consumer error handling.

And add some unit tests this time...
Merge pull request #16 from alphagov/fix_consumer_error_handling

Fix consumer error handling.