1
0
mirror of https://github.com/kepler155c/opus synced 2025-12-20 07:08:06 +00:00

Improved error messages

This commit is contained in:
kepler155c@gmail.com
2020-05-12 21:25:37 -06:00
parent 2629f2a172
commit 90ce2bb1a5
4 changed files with 53 additions and 35 deletions

View File

@@ -110,7 +110,7 @@ end
function Routine:run()
self.co = self.co or coroutine.create(function()
local result, err, fn
local result, err, fn, stack
if self.fn then
fn = self.fn
@@ -122,12 +122,12 @@ function Routine:run()
end
if fn then
result, err = trace(fn, table.unpack(self.args or { } ))
result, err, stack = trace(fn, table.unpack(self.args or { } ))
else
err = err or 'kernel: invalid routine'
end
pcall(self.onExit, self, result, err)
pcall(self.onExit, self, result, err, stack)
self:cleanup()
if not result then