Commits

Jason Perkins committed 5e74b5f

Fixed location of reported deprecation errors

  • Participants
  • Parent commits 04c74c7

Comments (0)

Files changed (2)

File premake5.lua

 --
 
 --
+-- Disable deprecation warnings for myself, so that older development
+-- versions will still be able to regenerate the scripts.
+--
+
+	premake.api.deprecations "off"
+
+--
 -- Define the project. Put the release configuration first so it will be the
 -- default when folks build using the makefile. That way they don't have to
 -- worry about the /scripts argument and all that.

File src/base/api.lua

 		if field.deprecated and type(field.deprecated.handler) == "function" and api._deprecations ~= "off" then
 			field.deprecated.handler(value)
 			premake.warnOnce(field.name, "the field %s has been deprecated.\n   %s", field.name, field.deprecated.message or "")
-			if api._deprecations == "error" then error({ msg="deprecation errors enabled" })  end
+			if api._deprecations == "error" then error("deprecation errors enabled", 3)  end
 		end
 
 		local target = api.gettarget(field.scope)
 				if handler.remove then handler.remove(value) end
 				local key = field.name .. "_" .. value
 				premake.warnOnce(key, "the %s value %s has been deprecated.\n   %s", field.name, value, handler.message or "")
-				if api._deprecations == "error" then error("deprecation errors enabled") end
+				if api._deprecations == "error" then error("deprecation errors enabled", 8) end
 			end
 		end