-include("oop.hrl").
-include("thrift.hrl").
+-include("tApplicationException.hrl").
-include("transport/tTransportException.hrl").
-include("transport/tServerSocket.hrl").
-include("transport/tErlAcceptor.hrl").
end.
receive_loop(This, Processor, Iprot, Oprot) ->
- try
- Value = ?R2(Processor, process, Iprot, Oprot),
- ?INFO(req_processed, {Value}),
- receive_loop(This, Processor, Iprot, Oprot)
+ try ?R2(Processor, process, Iprot, Oprot) of
+ {error, TAE} when is_record(TAE, tApplicationException),
+ TAE#tApplicationException.type == ?tApplicationException_HANDLER_ERROR ->
+ ?ERROR("handler returned an error: ~p", [oop:get(TAE, message)]),
+ receive_loop(This, Processor, Iprot, Oprot);
+ Value ->
+ ?INFO(req_processed, {Value}),
+ receive_loop(This, Processor, Iprot, Oprot)
catch
%% the following clause must be last because we might reexit
%% cpiro: breaks if it's a subclass of tTransportException
-behavior(oop).
--export([attr/4, super/0, inspect/1, catches/2]).
+-export([attr/4, super/0, inspect/1]).
-export([new/0, new/1, new/2,
effectful_setHandle/2, effectful_open/1,