Consider this:deploy()
{
doMyWork();
callThirdPartyCodeWhichCanEndUpThrowingThrowableOrRunTimeException();
}
Surely, my deployer/visitor isn't expected to catch Throwable and cleanup whatever I did in doMyWork(), or is it?
Sure it is.
How on earth should I know what a "revert-doMyWork()" looks like? ;-)
It should be then
deploy()
{
doMyWork();
try {
callThirdPartyCodeWhichCanEndUpThrowingThrowableOrRunTimeException();
} catch (E e) {
revertDoMyWork();
}
}