I'm working on a Thrift server which is basically just a wrapper around the Stanford Parser (although that's not too important). Sometimes the Stanford Parser will throw useful exceptions depending on the input it's given; for instance, if the input is too long (according to the parser), the user generating the input should receive this exception so they can decide how to handle it. However, I can't seem to get Thrift to pass this exception up, and instead only returns
Internal error processing <name of Thrift method being called>
to the client.
I have the following code in that method:
try
{
// a whole bunch of Stanford Parser stuff
}
catch (Exception e)
{
throw new TApplicationException(TApplicationException.INTERNAL_ERROR, e.getMessage());
}
and the method does throw a TApplicationException
, but whatever the contents of e.getMessage()
are are not being sent to the client. How can I get the exceptions being thrown by the Stanford Parser to be thrown by Thrift to the client?