equal
deleted
inserted
replaced
99 return ERROR_CODE(err); |
99 return ERROR_CODE(err); |
100 } |
100 } |
101 |
101 |
102 err_t nexus_lua_error (lua_State *L, int ret, struct error_info *err) |
102 err_t nexus_lua_error (lua_State *L, int ret, struct error_info *err) |
103 { |
103 { |
|
104 // XXX: this can raise an erorr itself |
104 const char *error = lua_tostring(L, -1); |
105 const char *error = lua_tostring(L, -1); |
105 |
106 |
106 switch (ret) { |
107 switch (ret) { |
107 case 0: RETURN_SET_ERROR(err, SUCCESS); |
108 case 0: RETURN_SET_ERROR(err, SUCCESS); |
108 case LUA_ERRSYNTAX: RETURN_SET_ERROR_STR(err, ERR_LUA_SYNTAX, error); |
109 case LUA_ERRSYNTAX: RETURN_SET_ERROR_STR(err, ERR_LUA_SYNTAX, error); |