critical -> error

This commit is contained in:
Feng Lee 2015-10-10 13:30:50 +08:00
parent 1935b414c7
commit fa84a2595b
2 changed files with 6 additions and 6 deletions

View File

@ -257,7 +257,7 @@ handle_call({unhook, Hook, Name}, _From, State) ->
{reply, Reply, State}; {reply, Reply, State};
handle_call(Req, _From, State) -> handle_call(Req, _From, State) ->
lager:critical("Unexpected request: ~p", [Req]), lager:error("Unexpected request: ~p", [Req]),
{reply, {error, badreq}, State}. {reply, {error, badreq}, State}.
handle_cast(_Msg, State) -> handle_cast(_Msg, State) ->

View File

@ -187,7 +187,7 @@ handle_call(_Request, _From, State) ->
{reply, ok, State}. {reply, ok, State}.
handle_cast(Msg, State) -> handle_cast(Msg, State) ->
lager:critical("Unexpected Msg: ~p", [Msg]), lager:error("Unexpected Msg: ~p", [Msg]),
{noreply, State}. {noreply, State}.
handle_info({'DOWN', _MRef, process, DownPid, _Reason}, State) -> handle_info({'DOWN', _MRef, process, DownPid, _Reason}, State) ->
@ -198,7 +198,7 @@ handle_info({'DOWN', _MRef, process, DownPid, _Reason}, State) ->
{noreply, State}; {noreply, State};
handle_info(Info, State) -> handle_info(Info, State) ->
lager:critical("Unexpected Info: ~p", [Info]), lager:error("Unexpected Info: ~p", [Info]),
{noreply, State}. {noreply, State}.
terminate(_Reason, #state{id = Id}) -> terminate(_Reason, #state{id = Id}) ->
@ -220,7 +220,7 @@ create_session(CleanSess, ClientId, ClientPid) ->
case insert_session(Session) of case insert_session(Session) of
{aborted, {conflict, ConflictPid}} -> {aborted, {conflict, ConflictPid}} ->
%% Conflict with othe node? %% Conflict with othe node?
lager:critical("Session(~s): Conflict with ~p!", [ClientId, ConflictPid]), lager:error("Session(~s): Conflict with ~p!", [ClientId, ConflictPid]),
{error, conflict}; {error, conflict};
{atomic, ok} -> {atomic, ok} ->
erlang:monitor(process, SessPid), erlang:monitor(process, SessPid),
@ -256,11 +256,11 @@ resume_session(Session = #mqtt_session{client_id = ClientId, sess_pid = SessPid}
ok -> ok ->
{ok, SessPid}; {ok, SessPid};
{badrpc, nodedown} -> {badrpc, nodedown} ->
lager:critical("Session(~s): Died for node ~s down!", [ClientId, Node]), lager:error("Session(~s): Died for node ~s down!", [ClientId, Node]),
remove_session(Session), remove_session(Session),
{error, session_nodedown}; {error, session_nodedown};
{badrpc, Reason} -> {badrpc, Reason} ->
lager:critical("Session(~s): Failed to resume from node ~s for ~p", lager:error("Session(~s): Failed to resume from node ~s for ~p",
[ClientId, Node, Reason]), [ClientId, Node, Reason]),
{error, Reason} {error, Reason}
end. end.