浏览代码

The default error handler is assigned to love.errorhandler.

Sasha Szpakowski 3 月之前
父节点
当前提交
dfdbe79138
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/modules/love/callbacks.lua

+ 4 - 1
src/modules/love/callbacks.lua

@@ -215,7 +215,7 @@ local function error_printer(msg, layer)
 	print((debug.traceback("Error: " .. tostring(msg), 1+(layer or 1)):gsub("\n[^\n]+$", "")))
 	print((debug.traceback("Error: " .. tostring(msg), 1+(layer or 1)):gsub("\n[^\n]+$", "")))
 end
 end
 
 
-function love.errhand(msg)
+function love.errorhandler(msg)
 	msg = tostring(msg)
 	msg = tostring(msg)
 
 
 	error_printer(msg, 2)
 	error_printer(msg, 2)
@@ -340,5 +340,8 @@ function love.errhand(msg)
 
 
 end
 end
 
 
+-- Legacy code support.
+love.errhand = love.errorhandler
+
 -- DO NOT REMOVE THE NEXT LINE. It is used to load this file as a C++ string.
 -- DO NOT REMOVE THE NEXT LINE. It is used to load this file as a C++ string.
 --)luastring"--"
 --)luastring"--"