[erlang-questions] terminate Cowboy
Thu Jul 31 14:08:52 CEST 2014
I have a problem with stopping Cowboy from a gen_server. I use trap exit.
This is the code.
terminate(_Reason, _State) ->
error_logger:info_msg("Cowboy was here"),
Rv = cowboy:stop_listener(xmlrpc_http_listener),
%Rv = 1 / 0,
error_logger:info_msg("Cowboy terminate Rv ~p", [Rv])
_:_ -> error_logger:info_msg("Cowboy CRASH")
I get the message "Cowboy was here" and nothing else. When I replace the
"cowboy:stop_listener" with the division by 0, the cowboy CRASH shows
up. Maybe that's because the compiler already detected the error?
Could somebody explain this behaviour?
More information about the erlang-questions