Changeset 565 for trunk/src/halEvent.hpp


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

Win32 exception catchers backported to branch.

File:
1 edited

Legend:

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