comparison Core/Lua/LuaFunctionCall.cpp @ 2954:d924f9bb61cc

taking advantage of details in OrthancException
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 03 Dec 2018 14:35:34 +0100
parents 878b59270859
children 4e43e67f8ecf
comparison
equal deleted inserted replaced
2953:210d5afd8f2b 2954:d924f9bb61cc
103 { 103 {
104 assert(lua_gettop(context_.lua_) >= 1); 104 assert(lua_gettop(context_.lua_) >= 1);
105 105
106 std::string description(lua_tostring(context_.lua_, -1)); 106 std::string description(lua_tostring(context_.lua_, -1));
107 lua_pop(context_.lua_, 1); /* pop error message from the stack */ 107 lua_pop(context_.lua_, 1); /* pop error message from the stack */
108 LOG(ERROR) << description;
109 108
110 throw OrthancException(ErrorCode_CannotExecuteLua); 109 throw OrthancException(ErrorCode_CannotExecuteLua, description);
111 } 110 }
112 111
113 if (lua_gettop(context_.lua_) < numOutputs) 112 if (lua_gettop(context_.lua_) < numOutputs)
114 { 113 {
115 throw OrthancException(ErrorCode_LuaBadOutput); 114 throw OrthancException(ErrorCode_LuaBadOutput);