mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 12:45:05 +00:00
* 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>
39 lines
803 B
Lua
39 lines
803 B
Lua
--[[
|
|
Defines the errors that can be returned by the reconciler.
|
|
]]
|
|
|
|
local Packages = script.Parent.Parent.Parent.Packages
|
|
local Fmt = require(Packages.Fmt)
|
|
|
|
local Error = {}
|
|
|
|
local function makeVariant(name)
|
|
Error[name] = setmetatable({}, {
|
|
__tostring = function()
|
|
return "Error." .. name
|
|
end,
|
|
})
|
|
end
|
|
|
|
makeVariant("CannotCreateInstance")
|
|
makeVariant("CannotDecodeValue")
|
|
makeVariant("LackingPropertyPermissions")
|
|
makeVariant("OtherPropertyError")
|
|
makeVariant("RefDidNotExist")
|
|
makeVariant("UnknownProperty")
|
|
makeVariant("UnreadableProperty")
|
|
makeVariant("UnwritableProperty")
|
|
|
|
function Error.new(kind, details)
|
|
return setmetatable({
|
|
kind = kind,
|
|
details = details,
|
|
}, Error)
|
|
end
|
|
|
|
function Error:__tostring()
|
|
return Fmt.fmt("Error({}): {:#?}", self.kind, self.details)
|
|
end
|
|
|
|
return Error
|