Hello, we have a funny problem with try catch and std::runtime_error. Can someone explain to me why this is returning "Unknown error" as output ? Thanks very much for helping me !
#include "stdafx.h"
#include <iostream>
#include <stdexcept>
int magicCode()
{
throw std::runtime_error("FunnyError");
}
int funnyCatch()
{
try{
magicCode();
} catch (std::exception& e) {
throw e;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
try
{
funnyCatch();
}
catch (std::exception& e)
{
std::cout << e.what();
}
return 0;
}