This patch fixes #694060, in which attempting to import an EC2 AMI that
didn't exist raised an exception that was not handled. The existing code
was not catching the exception properly, and the exception it was trying
to show contained multiple lines of debugging info. This should clean it
up.
Unfortunately, the test I added isn't able to test the exact failure (it
uses mock, not ec2), but it should still apply.
-- Matt