Changeset 289 in pacpusframework


Ignore:
Timestamp:
Mar 26, 2014, 9:27:40 PM (11 years ago)
Author:
Marek Kurdej
Message:

Minor: more diagnostic information on exceptions in DbitePlayer and PacpusSensor.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/DBITEPlayer/src/main.cpp

    r221 r289  
    4343#include <boost/assert.hpp>
    4444#include <boost/cstdlib.hpp>
     45#include <boost/exception/diagnostic_information.hpp>
    4546
    4647using namespace pacpus;
     
    5657
    5758    PacpusApplication app(argc, argv);
    58     ComponentManager * mgr = ComponentManager::getInstance();
     59    ComponentManager* mgr = ComponentManager::getInstance();
    5960
    6061    static ComponentFactory<DbtPlyEngine> factoryDbtPlyEngine("DbtPlyEngine");
     
    7980    }
    8081
    81     int exitStatus;
     82    int exitStatus = boost::exit_exception_failure;
    8283    try {
    8384        // start all the components (engine, trigger, user interface and the DBT file managers)
     
    8788        // stop all components before exiting app
    8889        mgr->stop();
    89 
    9090        mgr->destroy();
    9191    } catch (PacpusException& e) {
    92         LOG_WARN("Pacpus exception caught: " << e.what());
    93         exitStatus = boost::exit_exception_failure;
     92        LOG_FATAL("PacpusException caught:" << e.what() << "\n" << boost::diagnostic_information(e));
     93    } catch (boost::exception& e) {
     94        (void)e; // unused
     95        LOG_FATAL("boost::exception caught:" << boost::diagnostic_information(e));
     96    } catch (std::exception& e) {
     97        (void)e; // unused
     98        LOG_FATAL("std::exception caught:" << e.what());
    9499    }
    95100
  • trunk/src/PacpusLib/PacpusApplication.cpp

    r280 r289  
    9191    } catch (PacpusException& e) {
    9292        (void)e; // unused
    93         LOG_ERROR("PacpusException thrown:" << e.what() << "\n" << boost::diagnostic_information(e));
     93        LOG_ERROR("PacpusException caught:" << e.what() << "\n" << boost::diagnostic_information(e));
    9494    } catch (boost::exception& e) {
    9595        (void)e; // unused
    96         LOG_ERROR("boost::exception thrown:" << boost::diagnostic_information(e));
     96        LOG_ERROR("boost::exception caught:" << boost::diagnostic_information(e));
    9797    } catch (std::exception& e) {
    9898        (void)e; // unused
    99         LOG_ERROR("std::exception thrown:" << e.what());
     99        LOG_ERROR("std::exception caught:" << e.what());
    100100    }
    101101    return false;
  • trunk/src/PacpusSensor/src/main.cpp

    r162 r289  
    66/// @version    $Id: main.cpp 81 2013-01-11 22:31:02Z kurdejma $
    77
    8 #include <QApplication>
    9 
    108#include "ui/pacpusmainwindow.h"
    119#include <Pacpus/kernel/ComponentManager.h>
    1210#include <Pacpus/kernel/Log.h>
    1311#include <Pacpus/kernel/PacpusApplication.h>
     12#include <Pacpus/kernel/PacpusException.h>
     13
     14#include <boost/cstdlib.hpp>
     15#include <boost/exception/diagnostic_information.hpp>
     16#include <QApplication>
    1417#include <QThread>
    1518#ifdef WIN32
     
    6265    window.show();
    6366    LOG_INFO("Current Thread " << QThread::currentThread());
    64     // save application exit status
    65     int exitStatus = app.exec();
    66     // stop all components before exiting app
    67     mgr->stop();
    68 
    69     mgr->destroy();
     67   
     68    int exitStatus = boost::exit_exception_failure;
     69    try {
     70        // save application exit status
     71        exitStatus = app.exec();
     72        // stop all components before exiting app
     73        mgr->stop();
     74        mgr->destroy();
     75    } catch (PacpusException& e) {
     76        LOG_FATAL("PacpusException caught:" << e.what() << "\n" << boost::diagnostic_information(e));
     77    } catch (boost::exception& e) {
     78        (void)e; // unused
     79        LOG_FATAL("boost::exception caught:" << boost::diagnostic_information(e));
     80    } catch (std::exception& e) {
     81        (void)e; // unused
     82        LOG_FATAL("std::exception caught:" << e.what());
     83    }
    7084
    7185#ifdef WIN32
Note: See TracChangeset for help on using the changeset viewer.