<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello,<br>
<br>
I think I've found some problem in gen_server error report:<br>
<br>
when terminate callback throw errors then earlier errors (eg. from
handle_call callback) is not reported.<br>
<br>
Please compile and run provided simple_server.erl module, that
implement gen_server behaviour:<br>
<br>
(<a class="moz-txt-link-abbreviated"
href="mailto:compilation12836@zyndram.krakow.comarch">compilation12836@zyndram.krakow.comarch</a>)4>
simple_server:start_link(false).<br>
{ok,<0.128.0>}<br>
(<a class="moz-txt-link-abbreviated"
href="mailto:compilation12836@zyndram.krakow.comarch">compilation12836@zyndram.krakow.comarch</a>)5>
simple_server:perform(false).<br>
ok<br>
(<a class="moz-txt-link-abbreviated"
href="mailto:compilation12836@zyndram.krakow.comarch">compilation12836@zyndram.krakow.comarch</a>)6>
simple_server:perform(true).<br>
** exception exit: perform_error_in_handle_call<br>
<b> in function simple_server:handle_call/3
(loadController/src/simple_server.erl, line 89)</b><br>
in call from gen_server:try_handle_call/4 (gen_server.erl, line
629)<br>
in call from gen_server:handle_msg/5 (gen_server.erl, line 661)<br>
in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line
240)<br>
(<a class="moz-txt-link-abbreviated"
href="mailto:compilation12836@zyndram.krakow.comarch">compilation12836@zyndram.krakow.comarch</a>)7><br>
=ERROR REPORT==== 16-Mar-2016::15:36:35 ===<br>
** Generic server simple_server terminating<br>
** Last message in was {perform,true}<br>
** When Server state == {state,false}<br>
** Reason for termination ==<br>
** {perform_error_in_handle_call,<br>
[{simple_server,handle_call,3,<br>
[{file,"loadController/src/simple_server.erl"},{line,89}]},<br>
{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,629}]},<br>
{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,661}]},<br>
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}<br>
<br>
In this case we can see that exception was thrown 'in function
simple_server:handle_call/3 (loadController/src/simple_server.erl,
line 89)'<br>
<br>
And now please start server in this way:<br>
<br>
(<a class="moz-txt-link-abbreviated"
href="mailto:compilation12836@zyndram.krakow.comarch">compilation12836@zyndram.krakow.comarch</a>)7>
simple_server:start_link(true).<br>
{ok,<0.133.0>}<br>
(<a class="moz-txt-link-abbreviated"
href="mailto:compilation12836@zyndram.krakow.comarch">compilation12836@zyndram.krakow.comarch</a>)8>
simple_server:perform(false).<br>
ok<br>
(<a class="moz-txt-link-abbreviated"
href="mailto:compilation12836@zyndram.krakow.comarch">compilation12836@zyndram.krakow.comarch</a>)9>
simple_server:perform(true).<br>
<br>
=ERROR REPORT==== 16-Mar-2016::15:37:30 ===<br>
** Generic server simple_server terminating<br>
** Last message in was {perform,true}<br>
** When Server state == {state,true}<br>
** Reason for termination ==<br>
** {throw_error_in_terminate_callback,<br>
[{simple_server,terminate,2,<br>
[{file,"loadController/src/simple_server.erl"},{line,141}]},<br>
{gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,643}]},<br>
{gen_server,terminate,7,[{file,"gen_server.erl"},{line,809}]},<br>
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}<br>
** exception exit: throw_error_in_terminate_callback<br>
in function simple_server:terminate/2
(loadController/src/simple_server.erl, line 141)<br>
in call from gen_server:try_terminate/3 (gen_server.erl, line
643)<br>
in call from gen_server:terminate/7 (gen_server.erl, line 809)<br>
in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line
240)<br>
<br>
Now gen_server is also terminating, but we can only see exception
from terminate callback.<br>
<br>
Exception that causes gen_server termination is not reported.<br>
I rather expect that both exceptions will be shown.<br>
<br>
<br>
Regards<br>
Aleksander Nycz<br>
<br>
<br>
<pre class="moz-signature" cols="72">--
Aleksander Nycz
Chief Designer
Telco_021 BSS R&D
Comarch SA
Phone: +48 17 785 5909
Mobile: +48 691 464 275
website: <a class="moz-txt-link-abbreviated" href="http://www.comarch.pl">www.comarch.pl</a></pre>
</body>
</html>