27 lines
788 B
Text
27 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
|