Skip to content

BUG: coxpcall returns the error message twice #18

@Tieske

Description

@Tieske

This line:

return false, err(debug.traceback(co, (...)), ...)

as part of this function;

function handleReturnValue(err, co, status, ...)
if not status then
return false, err(debug.traceback(co, (...)), ...)
end

The vararg (...) is the result of the function called in protected mode. If that fails with an error "error", the result will become;

	false, "error+stacktrace", "error"

So the error is being returned twice, or more precisely all error results will be shifted by 1.

Since this bug has been in here for ages, and Lua 5.1 is getting obsolete, I'm not providing a PR, just this issue to document it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions