|
Boost Users : |
Subject: Re: [Boost-users] Unable to catch exception using boost::asio (boost::exception_detail::clone_imple<.....
From: Zachary Turner (divisortheory_at_[hidden])
Date: 2009-07-14 15:30:39
On Tue, Jul 14, 2009 at 11:56 AM, Alex Black<alex_at_[hidden]> wrote:
> I'm using boost::asio for sockets, writing a response out to a client.
>
> If the client stops part way through getting the response, then my server
> process dies:
>
> terminate called after throwing an instance of
> 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error>
>>'
> what(): Broken pipe
>
> The code though is surrounded by try catch like this:
>
> try
> {
> ...
> }
> catch ( std::exception& e )
> {
> cout << e.what() << endl;
> }
> catch ( ... )
> {
> cout << "unexpected exception" << endl;
> }
>
> How do I prevent my process from aborting/terminating like this?
>
Have you verified that the code inside the try block executes on the
same thread that the exception is occuring in?
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net