add debug

This commit is contained in:
anlicheng 2026-04-27 16:44:34 +08:00
parent 374d1d4e6a
commit 7c0ea0471e

View File

@ -47,7 +47,7 @@ init(Req0, Opts = [Mod|_]) ->
{ok, Req2, Opts}; {ok, Req2, Opts};
_:Error:Stack -> _:Error:Stack ->
logger:warning("[http_handler] get error: ~p, stack: ~p", [Error, Stack]), logger:warning("[http_handler] get error: ~p, stack: ~p", [Error, Stack]),
ErrorBin = term_to_binary(Error), ErrorBin = sdlan_util:term_to_binary(Error),
Req2 = cowboy_req:reply(500, #{ Req2 = cowboy_req:reply(500, #{
<<"Content-Type">> => <<"text/html;charset=utf-8">> <<"Content-Type">> => <<"text/html;charset=utf-8">>
}, <<"Internal Server Error: ", ErrorBin/binary>>, Req1), }, <<"Internal Server Error: ", ErrorBin/binary>>, Req1),