Re: [asio-users] Can't catch Boost.Asio exceptions inside coroutines
Brought to you by:
chris_kohlhoff
From: Sergey S. <rk...@rk...> - 2016-10-27 04:51:33
|
std::runtime_error is caught fine, only own asio errors like connection or resolve errors aren't. That's why I suspect asio and not just coroutines. On 27 Oct 2016 1:54 am, "Andrey Goryachev" <and...@gm...> wrote: > Have you tried to reproduce the bug without asio, just with > throw-catch in a boost coroutine? If it's a bug in Boost.Coroutine, > you probably should file it to boost's bug tracker or ask in boost's > mailing list. > > On Wed, Oct 26, 2016 at 11:38 PM, Sergey Shpikin <rk...@rk...> wrote: > > No, it works perfectly fine on Linux and catches exceptions where I > > need them. I tried to catch on iosrv.run() and it results in an access > > violation instead of std::terminate. I'll try Allen's suggestion soon, > > it also looks to me like a compiler issue but I'm used to MXE and not > > sure I'll be able to compile everything I need by hand. MXE includes > > lots of patches and settings to make everything to "just work" (well, > > not always probably). Do you have any ideas why exceptions could go > > through the handlers on Windows specifically? > > > > 2016-10-26 22:34 GMT+03:00 Igor R <boo...@gm...>: > >>> I have this little example of Boost.Asio code: > >>> http://codepad.org/tuQedXI7 It works as expected on Linux producing > >>> 1 > >>> 2 > >>> Caught Host not found (authoritative) > >>> > >>> but on Windows it crashes with: > >>> 1 > >>> 2 > >>> terminate called after throwing an instance of > 'boost::system::system_error' > >>> what(): Unknown error > >> > >> > >> Shouldn't the exception handler be around iosrv.run() ? > >> > >> ------------------------------------------------------------ > ------------------ > >> The Command Line: Reinvented for Modern Developers > >> Did the resurgence of CLI tooling catch you by surprise? > >> Reconnect with the command line and become more productive. > >> Learn the new .NET and ASP.NET CLI. Get your free copy! > >> http://sdm.link/telerik > >> _______________________________________________ > >> asio-users mailing list > >> asi...@li... > >> https://lists.sourceforge.net/lists/listinfo/asio-users > >> _______________________________________________ > >> Using Asio? List your project at > >> http://think-async.com/Asio/WhoIsUsingAsio > > > > ------------------------------------------------------------ > ------------------ > > The Command Line: Reinvented for Modern Developers > > Did the resurgence of CLI tooling catch you by surprise? > > Reconnect with the command line and become more productive. > > Learn the new .NET and ASP.NET CLI. Get your free copy! > > http://sdm.link/telerik > > _______________________________________________ > > asio-users mailing list > > asi...@li... > > https://lists.sourceforge.net/lists/listinfo/asio-users > > _______________________________________________ > > Using Asio? List your project at > > http://think-async.com/Asio/WhoIsUsingAsio > > ------------------------------------------------------------ > ------------------ > The Command Line: Reinvented for Modern Developers > Did the resurgence of CLI tooling catch you by surprise? > Reconnect with the command line and become more productive. > Learn the new .NET and ASP.NET CLI. Get your free copy! > http://sdm.link/telerik > _______________________________________________ > asio-users mailing list > asi...@li... > https://lists.sourceforge.net/lists/listinfo/asio-users > _______________________________________________ > Using Asio? List your project at > http://think-async.com/Asio/WhoIsUsingAsio > |