Files
rojo/plugin/src/invariant.lua
boatbomber e864cf0c7d Switch git submodules to Wally packages (#584)
* Switch git submodules to Wally packages

* Update build snapshot

* Add wally to foreman and use latest versions

* Install packages in CI runners

* Fix indents

* Install packages in the correct directory

* Install packages in correct dir of release action too

* Remove submodules from ci checkout

* Remove submodules from release checkout

* Update selene with latest fix

* Fix whitespace

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
2022-08-03 18:36:58 -04:00

32 lines
649 B
Lua

local Packages = script.Parent.Parent.Packages
local Fmt = require(Packages.Fmt)
local Config = require(script.Parent.Config)
local invariant
if Config.isDevBuild then
function invariant(message, ...)
message = Fmt.fmt(message, ...)
error("Invariant violation: " .. message, 2)
end
else
function invariant(message, ...)
message = Fmt.fmt(message, ...)
local fullMessage = string.format(
"Rojo detected an invariant violation within itself:\n" ..
"%s\n\n" ..
"This is a bug in Rojo. Please file an issue:\n" ..
"https://github.com/rojo-rbx/rojo/issues",
message
)
error(fullMessage, 2)
end
end
return invariant