Skip to content

Commit

Permalink
修改报错提示
Browse files Browse the repository at this point in the history
  • Loading branch information
znzsofficial committed Sep 9, 2023
1 parent d11e5af commit 0b0beba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion class.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ return setmetatable({
if type(config.methods) == "table" then
for name, fn in pairs(config.methods) do
if not type(fn) == "function" then
error("InvalidMethodException : Method must be a function or a lambda expression")
error("InvalidMethodException : Method must be a function")
elseif cls[name] and cls[name] ~= null then
error("RedefinedVariableException : Attempt to assign a defined value " .. name)
end
Expand Down
5 changes: 2 additions & 3 deletions object.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ return setmetatable({
end
-- 设置 call 元方法,用于创建实例
cls.__call = function(self)
error("InstantiationException : Attempt to instantiate a object " .. self.__name)

error("InstantiationException : Attempt to instantiate a object " .. self.__name)
end

-- 判断是否继承自另一个类
Expand Down Expand Up @@ -69,7 +68,7 @@ return setmetatable({
if type(config.methods) == "table" then
for name, fn in pairs(config.methods) do
if not type(fn) == "function" then
error("InvalidMethodException : Method must be a function or a lambda expression")
error("InvalidMethodException : Method must be a function")
elseif cls[name] and cls[name] ~= null then
error("RedefinedVariableException : Attempt to assign a defined value " .. name)
end
Expand Down

0 comments on commit 0b0beba

Please sign in to comment.