在 catch 中的以下 append ()是否会导致重新抛出的异常看到 append ()被调用的效果?
try {
mayThrowMyErr();
} catch (myErr &err) {
err.append("Add to my message here");
throw; // Does the rethrow exception reflect the call to append()?
}
类似地,如果我这样重写它,如果实际的异常是由 myErr 派生的,那么位切片会发生吗?
try {
mayThrowObjectDerivedFromMyErr();
} catch (myErr &err) {
err.append("Add to my message's base class here");
throw err; // Do I lose the derived class exception and only get myErr?
}