You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dr...@apache.org on 2008/06/11 02:56:42 UTC
svn commit: r666408 -
/incubator/thrift/trunk/lib/alterl/src/thrift_processor.erl
Author: dreiss
Date: Tue Jun 10 17:56:42 2008
New Revision: 666408
URL: http://svn.apache.org/viewvc?rev=666408&view=rev
Log:
Fix error logging to actually print error and stack trace for caught errors
Modified:
incubator/thrift/trunk/lib/alterl/src/thrift_processor.erl
Modified: incubator/thrift/trunk/lib/alterl/src/thrift_processor.erl
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/alterl/src/thrift_processor.erl?rev=666408&r1=666407&r2=666408&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/alterl/src/thrift_processor.erl (original)
+++ incubator/thrift/trunk/lib/alterl/src/thrift_processor.erl Tue Jun 10 17:56:42 2008
@@ -122,11 +122,14 @@
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,