From da07067489851ce502e34393f073fe4709b30e64 Mon Sep 17 00:00:00 2001 From: David Reiss Date: Wed, 11 Jun 2008 00:56:42 +0000 Subject: [PATCH] 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 --- lib/alterl/src/thrift_processor.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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, -- 2.17.1