|
Boost : |
From: rajesh daggumati (rajeshdaggumati9999_at_[hidden])
Date: 2021-09-29 10:24:35
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_info<boost::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<const Exception*>
(&exception)// here exception is type of exception_ptr
if(derived)
{
derived->severity(); // here exception is coming... if i put this
line in try block then its going for catch block and new exception is
being rasied. if i dont put try
block then *unknown file: error: SEH exception with code 0xc0000005 thrown
in the test body.*
}
Please help me to resolve this issue
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk