Changeset 565 for trunk


Ignore:
Timestamp:
08/29/08 18:19:52 (11 years ago)
Author:
Eoin
Message:

Win32 exception catchers backported to branch.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SplashDialog.hpp

    r564 r565  
    131131 
    132132                } 
    133                 catch (const access_violation& e)  
    134                 { 
    135                         hal::event_log.post(shared_ptr<hal::EventDetail>( 
    136                                 new hal::EventGeneral(hal::event_logger::warning, hal::event_logger::unclassified,  
    137                                 (hal::wform(L"Alert handler access_violation (code %1$x) at %2$x. IsWrite %3%, badd address %4$x") % e.code() % (unsigned)e.where() % e.isWrite() % (unsigned)e.badAddress()).str()))); 
    138                 } 
    139                 catch (const win32_exception& e)  
    140                 { 
    141                         hal::event_log.post(shared_ptr<hal::EventDetail>( 
    142                                 new hal::EventGeneral(hal::event_logger::warning, hal::event_logger::unclassified,  
    143                                 (hal::wform(L"Alert handler win32_exception (code %1$x) at %2$x") % e.code() % (unsigned)e.where()).str()))); 
    144                 } 
    145                 catch(std::exception& e) 
    146                 { 
    147                         hal::event_log.post(shared_ptr<hal::EventDetail>(\ 
    148                                 new hal::EventStdException(hal::event_logger::debug, e, L"SplashThread()"))); 
    149                 } 
    150                 catch(...) 
    151                 { 
    152                         HAL_DEV_MSG(L"SplashThread() catch all"); 
    153                 } 
     133                HAL_GENERIC_FN_EXCEPTION_CATCH(L"SplashThread()") 
    154134 
    155135                EndDialog(0); 
  • trunk/src/halEvent.hpp

    r539 r565  
    3030#include "global/string_conv.hpp" 
    3131 
     32#include <boost/preprocessor/cat.hpp> 
     33#include <boost/preprocessor/stringize.hpp> 
     34#include "win32_exception.hpp" 
     35 
    3236#include "halTorrent.hpp" 
    3337 
     
    3943#       define HAL_DEV_MSG(msg) 
    4044#endif 
     45 
     46#define HAL_GENERIC_FN_EXCEPTION_CATCH(FUNCTION) 
     47catch (const access_violation& e)  
     48{ 
     49        hal::event_log.post(shared_ptr<hal::EventDetail>( 
     50                new hal::EventGeneral(hal::event_logger::warning, hal::event_logger::unclassified,  
     51                (hal::wform(BOOST_PP_STRINGIZE(BOOST_PP_CAT(FUNCTION, L" access_violation (code %1$x) at %2$x. Bad address %3$x"))) % e.code() % (unsigned)e.where() % (unsigned)e.badAddress()).str()))); 
     52} 
     53catch (const win32_exception& e)  
     54{ 
     55        hal::event_log.post(shared_ptr<hal::EventDetail>( 
     56                new hal::EventGeneral(hal::event_logger::warning, hal::event_logger::unclassified,  
     57                (hal::wform(L"Alert handler win32_exception (code %1$x) at %2$x") % e.code() % (unsigned)e.where()).str()))); 
     58} 
     59catch(std::exception& e) 
     60{ 
     61        hal::event_log.post(shared_ptr<hal::EventDetail>(\ 
     62                new hal::EventStdException(hal::event_logger::debug, e, L"SplashThread()"))); 
     63} 
     64catch(...) 
     65{ 
     66        HAL_DEV_MSG(L"SplashThread() catch all"); 
     67} 
    4168 
    4269namespace hal  
Note: See TracChangeset for help on using the changeset viewer.