Browse Source

The default error handler is assigned to love.errorhandler.

Sasha Szpakowski 3 tháng trước cách đây
mục cha
commit
dfdbe79138
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  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]+$", "")))
 end
 
-function love.errhand(msg)
+function love.errorhandler(msg)
 	msg = tostring(msg)
 
 	error_printer(msg, 2)
@@ -340,5 +340,8 @@ function love.errhand(msg)
 
 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.
 --)luastring"--"