thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Artley <>
Subject Using TApplicationException - need example
Date Thu, 10 May 2012 23:06:20 GMT

Hello, I want to take exceptions on the server and return them back to the client. For example,
say the client's request leads to a run time exception like IllegalArgumentException. I think
that TApplicationException with INTERNAL_ERROR is the way to do this, but I couldn't get it
to work and I can't find any examples.

In my service handler, I check the args.  If they are invalid, I threw a TApplicationException
like this
  throw new TApplicationException(TApplicationException.INTERNAL_ERROR,"Illegal argument
blah blah");

It still showed up in my client as a TTransportException:

I'm sure I am just misunderstanding something.  What am I missing? Can anyone provide an
example of robust exception handling in the server to the client?

I read about it in THRIFT-378

View raw message