Explorar o código

try ... catch

Feng Lee %!s(int64=10) %!d(string=hai) anos
pai
achega
b701c9ec4f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/emqttd_pooler.erl

+ 1 - 1
src/emqttd_pooler.erl

@@ -75,7 +75,7 @@ handle_call(_Req, _From, State) ->
     {reply, ok, State}.
 
 handle_cast({async_submit, Fun}, State) ->
-    run(Fun),
+    try run(Fun) catch _:Error -> lager:error("Pooler Error: ~p", [Error]) end,
     {noreply, State};
 
 handle_cast(_Msg, State) ->