Closed andrewcox closed 8 years ago
I would follow the JAX-RS model where you have exception handlers that can rewrite the response. This allows you to catch exceptions that you can't annotate, and rewrite them into a proper error code.
Interesting. I've thought about this for the client calls for the srproxy client, to make it simpler to translate TApplicationException w/ specific codes into TTransportException.
On the server side I'm not convinced because you have limited options for what you'd be allowed to translate the excpetion to (you can only translate to the common TApplicationException, or else some other exception declared on @ThriftMethod annotations as throwable from that method. Anything else, and we wouldn't be able to serialize it.
lgtm