C++的异常处理方法之一.
try
{
if (error == DoSomething())
{
throw std::runtime_error("DoSomethin failed ");
}
}
catch (std::runtime_error& e)
{
logger->note("%s line %i : %s", e.what());
}
{
if (error == DoSomething())
{
throw std::runtime_error("DoSomethin failed ");
}
}
catch (std::runtime_error& e)
{
logger->note("%s line %i : %s", e.what());
}
浙公网安备 33010602011771号