This repository has been archived on 2024-04-19. You can view files and clone it, but cannot push or open issues or pull requests.
FREAX/etc/lib/exception
2022-07-18 19:33:40 +02:00

26 lines
788 B
Text

local instances = {}
instances.GenericException = function(text)
kerneldraw.printAppWarning(fs.getName(shell.getRunningProgram()), text)
log.writeSecurity(text)
end
instances.RestrictedOpsException = function(a)
b = a or " "
kerneldraw.printAppWarning("kernel", "Attempt to perform restricted operations")
log.writeSecurity("Attempt to perform restricted operations")
log.writeSecurity("Attempt blocked.")
end
instances.SecurityException = function(path)
kerneldraw.printAppWarning("kernel", "Attempt to perform restricted operations")
log.writeSecurity(_activeUser.." Attempted to open restricted file at "..path)
end
function throw(exception, arg)
if instances[exception] then
instances[exception](arg)
else
instances.GenericException("Exception not found")
end
end