thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Geyer" <jensge...@hotmail.com>
Subject Re: Thrift custom exceptions C++
Date Mon, 17 Feb 2014 20:51:48 GMT
Hi Ronald,

In my opinion, the behaviour is correct, as there is no inheritance of 
structural types with thrift, which includes exceptions. So the base class 
message_ field is not used with your custom exceptions, because it is not 
used :-) The string CTOR is solely (to be) used internally at various places 
in the C++ library code.

Have fun,
JensG


-----Urspr√ľngliche Nachricht----- 
From: Ronald van Gorkum
Sent: Monday, February 17, 2014 9:17 AM
To: thriftuser
Subject: Thrift custom exceptions C++

Hi all,

I defined some custom exceptions in the Thrift IDL. From this IDL I
generated C++ code. In the generated code the parent class (TException)
is inherited, but the constructor isn't called. When I receive an
exception I'm always receiving the default exception class instead of
the desired custom exception class. If I look into the sources the
parent class variable message_ is only set when the constructor of that
class is being called with the name of the custom exception (what is not
done in the generated code). Or, because the variable is protected, the
content is changed by the custom exception class, but also therefore is
no method generated. Who has also experiences with custom exceptions and
raise them in C++ code and has a proper solution? Or is this a Thrift
generator bug?

Thanks.

Ronald 


Mime
View raw message