From: David Reiss Date: Wed, 11 Jun 2008 00:56:42 +0000 (+0000) Subject: Fix error logging to actually print error and stack trace for caught errors X-Git-Tag: 0.2.0~752 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=da07067489851ce502e34393f073fe4709b30e64;p=common%2Fthrift.git Fix error logging to actually print error and stack trace for caught errors git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666408 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/alterl/src/thrift_processor.erl b/lib/alterl/src/thrift_processor.erl index 8cc53c30..8e077b80 100644 --- a/lib/alterl/src/thrift_processor.erl +++ b/lib/alterl/src/thrift_processor.erl @@ -122,11 +122,14 @@ handle_unknown_exception(State, Function, Exception) -> Exception}). handle_error(#state{out_protocol = OProto}, Function, Error) -> + Stack = erlang:get_stacktrace(), + error_logger:error_msg("~p had an error: ~p~n", [Function, {Error, Stack}]), + Message = case application:get_env(thrift, exceptions_include_traces) of {ok, true} -> lists:flatten(io_lib:format("An error occurred: ~p~n", - [{Error, erlang:get_stacktrace()}])); + [{Error, Stack}])); _ -> "An unknown handler error occurred." end,