The value of the foo property on your MyThing object will not be returned to any exception.
There is no block in your example try, but if it is, you can perform your own type of value rollback in the corresponding block catch.
try {
t.foo = "bar";
doSomethingRiskyWhichMightThrowMyException();
} catch(MyException e) {
t.foo = "rolledbackvalue";
}
source
share