Commits

Anonymous committed 416ed84

don't blow up in wmtrace with new-style delayed-receive reqdata

  • Participants
  • Parent commits 4ea8fae

Comments (0)

Files changed (1)

src/wmtrace_resource.erl

             D
     end.
 
-encode_request(ReqData) ->
+encode_request(ReqData) when is_record(ReqData, wm_reqdata) ->
     {struct, [{"method", atom_to_list(
                            wrq:method(ReqData))},
               {"path", wrq:raw_path(ReqData)},
               {"headers", encode_headers(wrq:req_headers(ReqData))},
-              {"body", case wrq:req_body(ReqData) of
+              {"body", case ReqData#wm_reqdata.req_body of
                            undefined -> [];
+                           Body when is_atom(Body) ->
+                               atom_to_list(Body);
                            Body -> lists:flatten(io_lib:format("~s", [Body]))
                        end}]}.