basho/riak_api — pull request #3 by rzezeski (2012-06-05 20:29:13+00:00)
Title: Log stacktrace during error

The Type/Reason for an error are almost always useless. I had to
dynamically trace the module just so I could find out why the tests
were failing. Include the stacktrace so when users have errors we can
actually diagnose them. Removed some of the lager calls because SASL
will already log on non-normal stop.

For example, with this change you'll see the following:

Reason: {error,function_clause,[{riak_pb_kv_codec,decode_quorum,[undefined],[{file,"src/riak_pb_kv_codec.erl"},{line,215}]},{riak_kv_pb_object,process,2,[{file,"src/riak_kv_pb_object.erl"},{line,231}]},{riak_api_pb_server,process_message,4,[{file,"src/riak_api_pb_server.erl"},{line,205}]},{riak_api_pb_server,handle_info,2,[{file,"src/riak_api_pb_server.erl"},{line,124}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,607}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}

before all you would see is

Reason: {error,function_clause}