OctOS: Improve error handling

Commands run and code called with the `lua` command would not throw an error if it was unsucessful.
master
octacian 2017-03-28 16:45:27 -07:00
parent 662c265cab
commit 5d59142b10
2 changed files with 8 additions and 4 deletions

View File

@ -1,8 +1,8 @@
local params = ...
local code = (table.concat(params, " "))
local res = run(code)
local ok, res = run(code)
if not res then
print("Error: Could not run `"..code.."`")
if not ok then
print("Error: "..res)
end

View File

@ -10,7 +10,11 @@ if input[1] ~= "" then
-- Remove first param
table.remove(input, 1)
fs.run(binentry.exec, input)
local ok, res = fs.run(binentry.exec, input)
if not ok then
print("Error: "..res)
end
else
print(input[1]..": command not found")
end