Write tests to make sure error handling works as expected.