diff options
author | Linus Nordberg <linus@nordberg.se> | 2014-10-29 15:59:10 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2014-10-29 15:59:10 +0100 |
commit | d79c260758e7544dd46de2adfad85d1c0bee859b (patch) | |
tree | b580925a77d14eaf1722b410bd0dabd795191a2e /src/catlfish_web.erl | |
parent | 5a10cf6fa6fff3cbca3340a7c75120603bda18ca (diff) | |
parent | 87e02103ea3f47b825b415c415f7d2940d009b42 (diff) |
Merge remote-tracking branch 'refs/remotes/map/external-merge3' into merging-external-merge
Conflicts:
src/v1.erl
tools/merge.py
tools/testcase1.py
Diffstat (limited to 'src/catlfish_web.erl')
-rw-r--r-- | src/catlfish_web.erl | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/catlfish_web.erl b/src/catlfish_web.erl index cdc1a39..f3231e4 100644 --- a/src/catlfish_web.erl +++ b/src/catlfish_web.erl @@ -2,16 +2,14 @@ %%% See LICENSE for licensing information. -module(catlfish_web). --export([start/2, stop/0, loop/2]). +-export([start/2, loop/2]). start(Options, Module) -> + lager:debug("Starting catlfish web server: ~p", [Module]), Loop = fun (Req) -> ?MODULE:loop(Req, Module) end, - mochiweb_http:start([{name, ?MODULE}, {loop, Loop} | Options]). - -stop() -> - mochiweb_http:stop(?MODULE). + mochiweb_http:start([{name, Module}, {loop, Loop} | Options]). loop(Req, Module) -> "/" ++ Path = Req:get(path), @@ -42,7 +40,8 @@ loop(Req, Module) -> end catch Type:What -> - lager:error("Crash in ~p for path ~p: ~p ~n~p~n~p~n", [Module, Path, Type, What, erlang:get_stacktrace()]), + [CrashFunction | Stack] = erlang:get_stacktrace(), + lager:error("Crash in ~p for path ~p: ~p ~p~n~p~n~p~n", [Module, Path, Type, What, CrashFunction, Stack]), Req:respond({500, [{"Content-Type", "text/plain"}], "Internal Server Error\n"}) end. |