svn commit: r331564 - head/stand/lua

Kyle Evans kevans at FreeBSD.org
Mon Mar 26 19:06:26 UTC 2018


Author: kevans
Date: Mon Mar 26 19:06:25 2018
New Revision: 331564
URL: https://svnweb.freebsd.org/changeset/base/331564

Log:
  lualoader: Actually re-raise error in try_include
  
  It was previously only printed, but we do actually want to raise it as a
  full blown error so that things don't look OK when they've actually gone
  wrong.
  
  The second parameter to error, level, is set to 2 here so that the error
  message reflects the position of the try_include caller, rather than the
  try_include itself. Example:
  
  LUA ERROR: /boot/lua/loader.lua:46: /boot/lua/local.lua:1: attempt to call a
  nil value (global 'cxcint').

Modified:
  head/stand/lua/core.lua

Modified: head/stand/lua/core.lua
==============================================================================
--- head/stand/lua/core.lua	Mon Mar 26 19:01:22 2018	(r331563)
+++ head/stand/lua/core.lua	Mon Mar 26 19:06:25 2018	(r331564)
@@ -56,7 +56,7 @@ function try_include(module)
 	-- configuration will not display 'module not found'. All other errors
 	-- in loading will be printed.
 	if config.verbose or ret:match("^module .+ not found") == nil then
-		print(ret)
+		error(ret, 2)
 	end
 	return nil
 end


More information about the svn-src-head mailing list