Raise errors from attributes for testing. I want it for bugpoint tests but it could be useful elsewhere.