diff --git a/include/emqttd_protocol.hrl b/include/emqttd_protocol.hrl index ee7b553d9..a335e8de7 100644 --- a/include/emqttd_protocol.hrl +++ b/include/emqttd_protocol.hrl @@ -40,14 +40,17 @@ %%------------------------------------------------------------------------------ %% MQTT QoS %%------------------------------------------------------------------------------ - -define(QOS_0, 0). %% At most once -define(QOS_1, 1). %% At least once -define(QOS_2, 2). %% Exactly once --define(IS_QOS(I), (I >= ?QOS_0 andalso I =< ?QOS_2)). +-define(QOS0, 0). %% At most once +-define(QOS1, 1). %% At least once +-define(QOS2, 2). %% Exactly once --type mqtt_qos() :: ?QOS_0 | ?QOS_1 | ?QOS_2. +-define(IS_QOS(I), (I >= ?QOS0 andalso I =< ?QOS2)). + +-type mqtt_qos() :: ?QOS0 | ?QOS1 | ?QOS2. -type mqtt_qos_name() :: qos0 | at_most_once | qos1 | at_least_once | diff --git a/src/emqttd_pooler.erl b/src/emqttd_pooler.erl index bec9f287a..13f4d6b8d 100644 --- a/src/emqttd_pooler.erl +++ b/src/emqttd_pooler.erl @@ -78,7 +78,10 @@ handle_call(_Req, _From, State) -> {reply, ok, State}. handle_cast({async_submit, Fun}, State) -> - try run(Fun) catch _:Error -> lager:error("Pooler Error: ~p", [Error]) end, + try run(Fun) + catch _:Error -> + lager:error("Pooler Error: ~p, ~p", [Error, erlang:get_stacktrace()]) + end, {noreply, State}; handle_cast(_Msg, State) ->