Quantcast

[Test] Message from unexpected exceptions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Test] Message from unexpected exceptions

Boost - Users mailing list
Hi,
 
Is there a way of configuring Boost.Test to display the message from unexpected exceptions?
 
I’m asking because at the moment whenever an unexpected exception is encountered by Boost.Test, it displays the type of the exception but not the message that goes with it making it more difficult to track down where the exception came from.  If apart from the type of the exception the exception message is included, it could quicken the resolution of the issue.
 
Kind regards,
Leo
 

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Test] Message from unexpected exceptions

Boost - Users mailing list
It should print the string from boost::current_exception_diagnostic_information().

On Thu, May 11, 2017 at 12:43 AM, Leo Carreon via Boost-users <[hidden email]> wrote:
Hi,
 
Is there a way of configuring Boost.Test to display the message from unexpected exceptions?
 
I’m asking because at the moment whenever an unexpected exception is encountered by Boost.Test, it displays the type of the exception but not the message that goes with it making it more difficult to track down where the exception came from.  If apart from the type of the exception the exception message is included, it could quicken the resolution of the issue.
 
Kind regards,
Leo


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Test] Message from unexpected exceptions

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
Le 11.05.17 à 09:43, Leo Carreon via Boost-users a écrit :

> Hi,
>
> Is there a way of configuring Boost.Test to display the message from
> unexpected exceptions?
>
> I’m asking because at the moment whenever an unexpected exception is
> encountered by Boost.Test, it displays the type of the exception but not
> the message that goes with it making it more difficult to track down
> where the exception came from.  If apart from the type of the exception
> the exception message is included, it could quicken the resolution of
> the issue.
>
> Kind regards,
> Leo

Normally it does, if your exception is one of the known type. See
execution_monitor.ipp lines 1239-- (including the snippet below,
restricted to "std::exception"'s)

What is the type of your exception?

Best,
Raffi

----------------------------------------

#if BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_cast )
     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_typeid )
#else
     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_cast )
     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_typeid )
#endif

     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_exception )
     CATCH_AND_REPORT_STD_EXCEPTION( std::domain_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::invalid_argument )
     CATCH_AND_REPORT_STD_EXCEPTION( std::length_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::out_of_range )
     CATCH_AND_REPORT_STD_EXCEPTION( std::range_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::overflow_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::underflow_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::logic_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::runtime_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::exception )




_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Test] Message from unexpected exceptions

Boost - Users mailing list
My exception is one derived from std::runtime_error.

-----Original Message-----
From: Raffi Enficiaud via Boost-users
Sent: Monday, May 15, 2017 7:30 PM
To: [hidden email]
Cc: Raffi Enficiaud
Subject: Re: [Boost-users] [Test] Message from unexpected exceptions

Le 11.05.17 à 09:43, Leo Carreon via Boost-users a écrit :

> Hi,
>
> Is there a way of configuring Boost.Test to display the message from
> unexpected exceptions?
>
> I’m asking because at the moment whenever an unexpected exception is
> encountered by Boost.Test, it displays the type of the exception but not
> the message that goes with it making it more difficult to track down
> where the exception came from.  If apart from the type of the exception
> the exception message is included, it could quicken the resolution of
> the issue.
>
> Kind regards,
> Leo

Normally it does, if your exception is one of the known type. See
execution_monitor.ipp lines 1239-- (including the snippet below,
restricted to "std::exception"'s)

What is the type of your exception?

Best,
Raffi

----------------------------------------

#if BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_cast )
     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_typeid )
#else
     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_cast )
     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_typeid )
#endif

     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_exception )
     CATCH_AND_REPORT_STD_EXCEPTION( std::domain_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::invalid_argument )
     CATCH_AND_REPORT_STD_EXCEPTION( std::length_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::out_of_range )
     CATCH_AND_REPORT_STD_EXCEPTION( std::range_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::overflow_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::underflow_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::logic_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::runtime_error )
     CATCH_AND_REPORT_STD_EXCEPTION( std::exception )




_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users 

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Test] Message from unexpected exceptions

Boost - Users mailing list
Le 16.05.17 à 01:25, Leo Carreon via Boost-users a écrit :
> My exception is one derived from std::runtime_error.
>

Would you then please file a bug [1] and post a snippet reproducing the
error?

Thanks,
Raffi

[1] https://svn.boost.org/trac/boost/newticket

> -----Original Message----- From: Raffi Enficiaud via Boost-users
> Sent: Monday, May 15, 2017 7:30 PM
> To: [hidden email]
> Cc: Raffi Enficiaud
> Subject: Re: [Boost-users] [Test] Message from unexpected exceptions
>
> Le 11.05.17 à 09:43, Leo Carreon via Boost-users a écrit :
>> Hi,
>>
>> Is there a way of configuring Boost.Test to display the message from
>> unexpected exceptions?
>>
>> I’m asking because at the moment whenever an unexpected exception is
>> encountered by Boost.Test, it displays the type of the exception but not
>> the message that goes with it making it more difficult to track down
>> where the exception came from.  If apart from the type of the exception
>> the exception message is included, it could quicken the resolution of
>> the issue.
>>
>> Kind regards,
>> Leo
>
> Normally it does, if your exception is one of the known type. See
> execution_monitor.ipp lines 1239-- (including the snippet below,
> restricted to "std::exception"'s)
>
> What is the type of your exception?
>
> Best,
> Raffi
>
> ----------------------------------------
>
> #if BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
>     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_cast )
>     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_typeid )
> #else
>     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_cast )
>     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_typeid )
> #endif
>
>     CATCH_AND_REPORT_STD_EXCEPTION( std::bad_exception )
>     CATCH_AND_REPORT_STD_EXCEPTION( std::domain_error )
>     CATCH_AND_REPORT_STD_EXCEPTION( std::invalid_argument )
>     CATCH_AND_REPORT_STD_EXCEPTION( std::length_error )
>     CATCH_AND_REPORT_STD_EXCEPTION( std::out_of_range )
>     CATCH_AND_REPORT_STD_EXCEPTION( std::range_error )
>     CATCH_AND_REPORT_STD_EXCEPTION( std::overflow_error )
>     CATCH_AND_REPORT_STD_EXCEPTION( std::underflow_error )
>     CATCH_AND_REPORT_STD_EXCEPTION( std::logic_error )
>     CATCH_AND_REPORT_STD_EXCEPTION( std::runtime_error )
>     CATCH_AND_REPORT_STD_EXCEPTION( std::exception )


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Loading...