{ok,RequestData,_} = rfc4627:decode(Arg#arg.clidata)
When it match the Output of
rfc4627:decode(Arg#arg.clidata)
to
{ok,RequestData,_}
it gives a {badmatch, ....} error
But I Copied the output in the error msg and matched to
{ok,RequestData,_}
in a erlang shell, Then it matches without any error.
This error only happens randomly. I can't figure out a reason. Sometimes it match and code works without any error. And sometimes it gives a error and yaws code crashes.
This is the error msg
<h2>Internal error, yaws code crashed</h2><br /><hr />
<pre>
ERROR erlang code threw an uncaught exception:
File: /usr/local/var/yaws/www/prime/yaws/session.yaws:1
Class: error
Exception: {badmatch,{ok,{obj,[{"action",<<"GET_SESSION_INFO">>}]},[]}}
Req: {http_request,'POST',{abs_path,"/prime/yaws/session.yaws"},{1,1}}
Stack: [{session,handle,2,
[{file,"/root/.yaws/yaws/default/session.erl"},{line,30}]},
{yaws_server,deliver_dyn_part,8,
[{file,"yaws_server.erl"},{line,2801}]},
{yaws_server,aloop,4,[{file,"yaws_server.erl"},{line,1215}]},
{yaws_server,acceptor0,2,[{file,"yaws_server.erl"},{line,1052}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]
</pre><hr />