Changeset 280 in pacpusframework for trunk/src/PacpusLib


Ignore:
Timestamp:
Mar 20, 2014, 11:59:05 AM (11 years ago)
Author:
Marek Kurdej
Message:

Major: DbiteException uses boost::exception.

Location:
trunk/src/PacpusLib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/PacpusLib/ComponentBase.cpp

    r279 r280  
    509509    } catch (po::error& e) {
    510510        LOG_WARN(e.what());
    511         throw PacpusException(e.what());
     511        BOOST_THROW_EXCEPTION(PacpusException(e.what()));
    512512    }
    513513
  • trunk/src/PacpusLib/PacpusApplication.cpp

    r222 r280  
    8989    try {
    9090        return QApplication::notify(receiver, ev);
    91     } catch (PacpusException & e) {
     91    } catch (PacpusException& e) {
    9292        (void)e; // unused
    93         LOG_ERROR("PacpusException thrown:" << e.what());
    94     } catch (boost::exception & e) {
     93        LOG_ERROR("PacpusException thrown:" << e.what() << "\n" << boost::diagnostic_information(e));
     94    } catch (boost::exception& e) {
    9595        (void)e; // unused
    9696        LOG_ERROR("boost::exception thrown:" << boost::diagnostic_information(e));
    97     } catch (std::exception & e) {
     97    } catch (std::exception& e) {
    9898        (void)e; // unused
    9999        LOG_ERROR("std::exception thrown:" << e.what());
     
    125125    std::stringstream errorMessage;
    126126    errorMessage << "received signal number " << signal;
    127     throw PacpusException(errorMessage.str());
     127    BOOST_THROW_EXCEPTION(PacpusException(errorMessage.str())
     128        << errinfo_signal(signal)
     129    );
    128130}
  • trunk/src/PacpusLib/PacpusException.cpp

    r156 r280  
    1010using namespace pacpus;
    1111
    12 PacpusException::PacpusException(const std::string & what)
    13     : mWhat(what)
     12PacpusException::PacpusException(std::string const& what)
     13    : std::runtime_error(what)
    1414{
    1515}
    1616
    17 PacpusException::~PacpusException() throw()
     17PacpusException::~PacpusException()
    1818{
    1919}
    20 
    21 const char * PacpusException::what() const throw()
    22 {
    23     return mWhat.c_str();
    24 }
  • trunk/src/PacpusLib/XmlConfigFile.cpp

    r231 r280  
    88
    99#include <Pacpus/kernel/Log.h>
     10#include <Pacpus/kernel/PacpusException.h>
    1011
    1112#include <cassert>
     
    6768    } else {
    6869        LOG_ERROR("cannot open XML document " << kXmlConfigFilename);
    69         throw "cannot open XML document file";
     70        BOOST_THROW_EXCEPTION(PacpusException("cannot open XML document file"));
    7071    }
    7172}
Note: See TracChangeset for help on using the changeset viewer.