diff Core/Lua/LuaContext.cpp @ 1438:af112b7d9cba

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 01 Jul 2015 09:56:41 +0200
parents 02f5a3f5c0a0
children 5ba7471780ae
line wrap: on
line diff
--- a/Core/Lua/LuaContext.cpp	Tue Jun 30 18:41:33 2015 +0200
+++ b/Core/Lua/LuaContext.cpp	Wed Jul 01 09:56:41 2015 +0200
@@ -172,7 +172,7 @@
     if (nArgs != 1 || !lua_isstring(state, 1))  // URL
     {
       LOG(ERROR) << "Lua: Bad parameters to HttpGet()";
-      lua_pushstring(state, "ERROR");
+      lua_pushnil(state);
       return 1;
     }
 
@@ -185,7 +185,7 @@
     if (!that.AnswerHttpQuery(state))
     {
       LOG(ERROR) << "Lua: Error in HttpGet() for URL " << url;
-      lua_pushstring(state, "ERROR");
+      lua_pushnil(state);
     }
 
     return 1;
@@ -204,7 +204,7 @@
         (nArgs >= 2 && !lua_isstring(state, 2)))  // Body data
     {
       LOG(ERROR) << "Lua: Bad parameters to HttpPost() or HttpPut()";
-      lua_pushstring(state, "ERROR");
+      lua_pushnil(state);
       return 1;
     }
 
@@ -226,7 +226,7 @@
     if (!that.AnswerHttpQuery(state))
     {
       LOG(ERROR) << "Lua: Error in HttpPost() or HttpPut() for URL " << url;
-      lua_pushstring(state, "ERROR");
+      lua_pushnil(state);
     }
 
     return 1;
@@ -254,7 +254,7 @@
     if (nArgs != 1 || !lua_isstring(state, 1))  // URL
     {
       LOG(ERROR) << "Lua: Bad parameters to HttpDelete()";
-      lua_pushstring(state, "ERROR");
+      lua_pushnil(state);
       return 1;
     }
 
@@ -268,7 +268,7 @@
     if (!that.httpClient_.Apply(s))
     {
       LOG(ERROR) << "Lua: Error in HttpDelete() for URL " << url;
-      lua_pushstring(state, "ERROR");
+      lua_pushnil(state);
     }
     else
     {