{ok, ZlibData} ->
{reply, {ok, ZlibSocket},
process_data(ZlibData, NewState), ?HIBERNATE_TIMEOUT};
- {error, _Reason} ->
- {stop, normal, ok, NewState}
+ {error, _} = Err ->
+ {stop, normal, Err, NewState}
end;
handle_call(reset_stream, _From, State) ->
NewState = reset_parser(State),
(State#state.sock_mod):send(State#state.socket, Data).
do_call(Pid, Msg) ->
- case catch ?GEN_SERVER:call(Pid, Msg) of
- {'EXIT', Why} -> {error, Why};
- Res -> Res
+ try ?GEN_SERVER:call(Pid, Msg) of
+ Res -> Res
+ catch _:{timeout, _} ->
+ {error, timeout};
+ _:_ ->
+ {error, einval}
end.