comparison Core/Lua/LuaContext.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 c8d369400ae1
children 4e43e67f8ecf
comparison
equal deleted inserted replaced
2953:210d5afd8f2b 2954:d924f9bb61cc
585 { 585 {
586 assert(lua_gettop(lua_) >= 1); 586 assert(lua_gettop(lua_) >= 1);
587 587
588 std::string description(lua_tostring(lua_, -1)); 588 std::string description(lua_tostring(lua_, -1));
589 lua_pop(lua_, 1); /* pop error message from the stack */ 589 lua_pop(lua_, 1); /* pop error message from the stack */
590 LOG(ERROR) << "Error while executing Lua script: " << description; 590 throw OrthancException(ErrorCode_CannotExecuteLua, description);
591 throw OrthancException(ErrorCode_CannotExecuteLua);
592 } 591 }
593 592
594 if (output != NULL) 593 if (output != NULL)
595 { 594 {
596 *output = log_; 595 *output = log_;