spulec/moto — pull request #167 by DreadPirateShawn (2014-08-25 18:01:28+00:00)
Title: Error handling: Model-level validations, proper error responses.

Fix for issue #166, with fleshed-out error handling.

All of the same error handling exists, simply moved from response handlers to models, to ensure consistent behavior.

Tests have been updated to validate the specific error code of each error, as well as the status code and request ID, replacing all existing "should.throw(EC2ResponseError)" tests.

(PS: One test was changed from expecting OK to expecting an error -- namely, "get_all_addresses" for an invalid IP in "tests/test_ec2/test_elastic_ip_addresses.py" -- boto repro confirmed "InvalidAddress.NotFound" is the proper response.)