fix(exproto): fix badarg is_process_alive/1
This commit is contained in:
parent
dffa81120c
commit
473e600b53
|
@ -123,12 +123,14 @@ call(ConnStr, Req) ->
|
||||||
{error, ?RESP_PARAMS_TYPE_ERROR,
|
{error, ?RESP_PARAMS_TYPE_ERROR,
|
||||||
<<"The conn type error">>};
|
<<"The conn type error">>};
|
||||||
Pid when is_pid(Pid) ->
|
Pid when is_pid(Pid) ->
|
||||||
case erlang:is_process_alive(Pid) of
|
case catch emqx_exproto_conn:call(Pid, Req) of
|
||||||
true ->
|
{'EXIT',{noproc, _}} ->
|
||||||
emqx_exproto_conn:call(Pid, Req);
|
|
||||||
false ->
|
|
||||||
{error, ?RESP_CONN_PROCESS_NOT_ALIVE,
|
{error, ?RESP_CONN_PROCESS_NOT_ALIVE,
|
||||||
<<"Connection process is not alive">>}
|
<<"Connection process is not alive">>};
|
||||||
|
{'EXIT',{timeout, _}} ->
|
||||||
|
{error, ?RESP_UNKNOWN, <<"Connection is not answered">>};
|
||||||
|
Result ->
|
||||||
|
Result
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue