Changeset 221 in pacpusframework for trunk/src/DBITEPlayer


Ignore:
Timestamp:
Nov 13, 2013, 4:00:05 PM (11 years ago)
Author:
Marek Kurdej
Message:

Catching exceptions in DbitePlayer.

File:
1 edited

Legend:

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

    r205 r221  
    3838#include <Pacpus/kernel/Log.h>
    3939#include <Pacpus/kernel/PacpusApplication.h>
     40#include <Pacpus/kernel/PacpusException.h>
    4041#include <Pacpus/kernel/PacpusPluginInterface.h>
    4142
    42 #include <cassert>
     43#include <boost/assert.hpp>
     44#include <boost/cstdlib.hpp>
    4345
    4446using namespace pacpus;
     
    7779    }
    7880
    79     // start all the components (engine, trigger, user interface and the DBT file managers)
    80     mgr->start();
    81     // save application exit status
    82     int exitStatus = app.exec();
    83     // stop all components before exiting app
    84     mgr->stop();
     81    int exitStatus;
     82    try {
     83        // start all the components (engine, trigger, user interface and the DBT file managers)
     84        mgr->start();
     85        // save application exit status
     86        exitStatus = app.exec();
     87        // stop all components before exiting app
     88        mgr->stop();
    8589
    86     mgr->destroy();
     90        mgr->destroy();
     91    } catch (PacpusException& e) {
     92        LOG_WARN("Pacpus exception caught: " << e.what());
     93        exitStatus = boost::exit_exception_failure;
     94    }
    8795
    8896    // return application exit status
Note: See TracChangeset for help on using the changeset viewer.