HI Team,
// i have caught exception in exception_ptr and I and trying to convert to
ExceptionPtr_t but I am facing issue at below derived->severity().
* unknown file: error: SEH exception with code 0xc0000005 thrown in the
test body.*
*code snippet is :*
*E*xceptionPtr_t ExceptionHelper::TryGetExceptionPtr(boost::exception_ptr
exception)
{
ExceptionPtr_t result ;
std::string res;
if(!exception) return result;
try
{
boost::rethrow_exception(exception)
*}catch(boost::exception &e)*
*{boost::throw_file::value_type const* throw_file_data =
boost::get_error_infoboost::throw_file(e);*
*if(* *throw_file_data)*
*{*
* result = exceptionPtr_t(new
ExceptionWrapper(exception,*throw_filed_data,true))*
*}*
*return result;*
*}*
class Exception : public virtual std::exception, public virtual
boost::exception
{
protected:
string what;
serviorytype m_severity;
public:
explicit Exception(const std::string& what);
virtual ~Exception() throw() {}
// we have some member functions like severity(),setseverity(value)...
}
class ExceptionWrapper : public Exception
{
private:
string m_what_inner;
boost::exception_ptr m_inner;
public:
explict ExceptionWrapper(boost::exception_ptr inner,string &what() =
std::string,bool copythrow = true);
explict ExceptionWrapper(boost::exceptionPtr_t inner,string &what() =
std::string,bool copythrow = true);
virtual ~ExceptionWrapper() throw(){}
// some methods like severity(),setSeverity(value),.....)
}
I was doing like:
const Exception* derived = reinterPret_cast