Skip to content

Commit

Permalink
Fix NoYield to give a useful stack trace in all cases (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
LPGhatguy authored May 2, 2018
1 parent 576767d commit d1161cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/NoYield.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

local function resultHandler(co, ok, ...)
if not ok then
local err = (...)
error(err, 2)
local message = (...)
error(debug.traceback(co, message), 2)
end

if coroutine.status(co) ~= "dead" then
Expand Down
1 change: 1 addition & 0 deletions lib/NoYield.spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ return function()

expect(ok).to.equal(false)
expect(err:find("foo")).to.be.ok()
expect(err:find("NoYield.spec")).to.be.ok()
end)
end

0 comments on commit d1161cd

Please sign in to comment.