Changeset 289 in pacpusframework for trunk/src/PacpusSensor/src/main.cpp


Ignore:
Timestamp:
03/26/14 21:27:40 (10 years ago)
Author:
Marek Kurdej
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.