//Rethrowing 实质还是异常的嵌套
#include<iostream>
using namespace std;int main()
{
try
{
try
{
exception e("It's my error");
cout << "I'm trying" << endl;
throw e;
}
catch (exception &e)
{
cout << "I'm First Exception but I can't handle it" << endl;
//可改变异常的状态//正是c++ primer 中所提及的
throw;
}
}
catch (exception &e)
{
cout << "I'm Second Exception if you can't handle it let me handle it" << endl;
}
system("pause");
return 0;
}