I am using a library (oatpp
web service framework) that launches threads that call my handlers. So I have no control over the outermost code of the threads to insert __try
...__except
there (I need it for core dumps).
The handler implementations look like the following:
shared_ptr<oatpp::web::server::HttpRequestHandler::OutgoingResponse> DownloadRequestHandler::handle(
const std::shared_ptr<IncomingRequest>& request)
{
__try {
return handleGuarded(request);
}
__except (Debugging::GenerateDump(GetExceptionInformation(), GetExceptionCode())) {
quick_exit(4);
}
}
So the point is that this method needs to forward the response object returned from the guarded method and this object (shared_ptr
) is unwindable. Because of this, I'm getting error C2712: Cannot use __try in functions that require object unwinding
.
Could you please advise on how to work around this problem?