<p>Christof Lauber has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8875">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pbx_lua: Support displaying lua error message if no debug table exists<br><br>The lua_error_function assumed that lua's debug table and traceback function<br>are always accessible, which is not the case. This fixes the error message<br>'Error in the lua error handler' triggred by switch exec() function.<br>If this happens lua's error message is shown without traceback.<br><br>Change-Id: Ia8d15b03188ac47211afabfa9b583ffa82411a9a<br>---<br>M pbx/pbx_lua.c<br>1 file changed, 2 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/75/8875/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/pbx/pbx_lua.c b/pbx/pbx_lua.c<br>index 7a894b6..8673dfd 100644<br>--- a/pbx/pbx_lua.c<br>+++ b/pbx/pbx_lua.c<br>@@ -808,15 +808,14 @@<br> if (!lua_istable(L, -1)) {<br> /* Have no 'debug' table for whatever reason */<br> lua_pop(L, 2);<br>- /* Keep at least original err message */<br>- lua_pushvalue(L, message_index);<br>+ /* Original err message is on stack top now */<br> return 1;<br> }<br> lua_getfield(L, -1, "traceback");<br> if (!lua_isfunction(L, -1)) {<br> /* Same here for traceback function */<br> lua_pop(L, 3);<br>- lua_pushvalue(L, message_index);<br>+ /* Original err message is on stack top now */<br> return 1;<br> }<br> lua_remove(L, -2); /* remove the 'debug' table */<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8875">change 8875</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8875"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ia8d15b03188ac47211afabfa9b583ffa82411a9a </div>
<div style="display:none"> Gerrit-Change-Number: 8875 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Christof Lauber <christof.lauber@annax.ch> </div>