I'd like to throws some java built-in exception such IOException in the Thrift IDL.
like this:
service B{
void removeLease() throws (1:ioexception e),
}
however, the Thrift compiler warns that ioexception doesn't be defined.
I'd like to throws some java built-in exception such IOException in the Thrift IDL.
like this:
service B{
void removeLease() throws (1:ioexception e),
}
however, the Thrift compiler warns that ioexception doesn't be defined.
Thrift IDL is language agnostic.You cannot use built-in exceptions(like IOException in this case) You can define and use your own "ioexception"
Every java exception is serializable, so it's possible to wrap it into thrift exception.
Thrift code:
Java server code:
Java client code:
So, the client gets full exception together with stacktrace, etc. We use this approach is several projects, it works for sure.