thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Emmenlauer <ma...@emmenlauer.de>
Subject map all std::exceptions to a derived TException?
Date Thu, 26 Sep 2019 09:36:39 GMT

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

Mime
View raw message