Result.
-handle_application_exception(_State) ->
- not_yet_impl.
+handle_application_exception(State = #state{protocol = Proto}) ->
+ {ok, Exception} = thrift_protocol:read(Proto,
+ ?TApplicationException_Structure),
+ ok = thrift_protocol:read(Proto, message_end),
+ XRecord = list_to_tuple(
+ ['TApplicationException' | tuple_to_list(Exception)]),
+ io:format("X: ~p~n", [XRecord]),
+ true = is_record(XRecord, 'TApplicationException'),
+ {exception, XRecord}.
hello.i64_thing = (int64_t)arg2;
}
- void testException(const std::string &arg) throw(Xception) {
+ void testException(const std::string &arg)
+ throw(Xception, facebook::thrift::TException)
+ {
printf("testException(%s)\n", arg.c_str());
if (arg.compare("Xception") == 0) {
Xception e;
e.errorCode = 1001;
e.message = "This is an Xception";
throw e;
+ } else if (arg.compare("ApplicationException") == 0) {
+ facebook::thrift::TException e;
+ throw e;
} else {
Xtruct result;
result.string_thing = arg;