You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Mario Emmenlauer <ma...@emmenlauer.de> on 2019/09/26 09:36:39 UTC

map all std::exceptions to a derived TException?

Dear thrift community,

Our server code uses exceptions to signal fatal errors. On Linux and
MacOS I found that thrift would pass std::exception just fine through
the API. I'm not sure if this is intended but its pretty neat. On
MSVC it kills the server, though (not to much surprise).

So in my service handler I end up putting every method in a try-
catch only to translate std::exception to something derived from
TException.

Instead of copy-pasting this in all methods I'm wondering if a similar
mechanism exists in thrift? Or where is the place in thrift where one
could catch further exception types to translate them ad pass them
to the client?

All the best,

    Mario Emmenlauer