You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/05/11 06:01:19 UTC

[21/32] git commit: Puke when the lua load fails

Puke when the lua load fails


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/92101295
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/92101295
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/92101295

Branch: refs/heads/jpeach/lua
Commit: 92101295cb5c1dfb40ac8a5b87fa6ca39a11af2e
Parents: 6eacee6
Author: James Peach <jp...@apache.org>
Authored: Tue Apr 17 22:17:03 2012 -0700
Committer: James Peach <jp...@apache.org>
Committed: Thu May 10 20:23:42 2012 -0700

----------------------------------------------------------------------
 plugins/lua/lua.cc |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/92101295/plugins/lua/lua.cc
----------------------------------------------------------------------
diff --git a/plugins/lua/lua.cc b/plugins/lua/lua.cc
index f308524..74a4631 100644
--- a/plugins/lua/lua.cc
+++ b/plugins/lua/lua.cc
@@ -145,8 +145,10 @@ TSRemapNewInstance(int argc, char * argv[], void ** ih, char * errbuf, int errbu
       TSDebug("lua", "%s loading lua file %s", __func__, argv[i]);
       if (luaL_dofile(lua, argv[i]) != 0) {
         // If the load failed, it should have pushed an error message.
-        TSError("lua load error: %s", lua_tostring(lua, -1));
+        TSError("error loading %s: %s", argv[i], lua_tostring(lua, -1));
         lua_pop(lua, 1);
+        lua_close(lua);
+        return TS_ERROR;
       }
     }
   }