Beispiel #1
0
void FatalException(Exception &e, std::string const &location) {
    DataError *pDataError = dynamic_cast<DataError*> (&e);
    CSPLOG(ERROR, APP) << "CSPSim: caught exception in " << location << ": " << e.getMessage();
    std::cerr << "\n";
    e.details();
    std::cerr << "\n";
    if (pDataError) {
        std::cerr
                << "Please check that the data paths in CSPSim.ini are set to reasonable\n"
                << "values (CSPSim.ini is usually found in CSPSim/Data).  If you appear\n"
                << "to be missing a necessary data file, please check the CSP download\n"
                << "page for the latest data releases or ask for assistance on the CSP\n"
                << "forums:\n"
                << "                http://csp.sourceforge.net/forum\n";
    }
    else {
        std::cerr
                << "CSPSim: caught an exception.  Please report this along with\n"
                << "as much information as possible about what was happening at \n"
                << "the time of the error to the CSP forum at\n"
                << "              http://csp.sourceforge.net/forum\n";
    }
    std::cerr << std::endl;
    ::exit(1);
}
Beispiel #2
0
Message::Message(const Exception& e, DistributionRealm realm, 
		 PayloadSignificance sig, bool highlight) throw():
  m_hostname(s_this_hostname), m_origin(MO_LOCAL), m_zone(-1),
  m_program(s_this_program), m_title(e.title()), m_realm(realm), 
  m_significance(sig), m_message_oss(e.message()), m_details_oss(e.details()), 
  m_function(e.function(highlight)), m_time()
{
  m_time.tv_sec=e.time().tv_sec;
  m_time.tv_usec=e.time().tv_usec;
}