Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coroutine.wrap does not propagate errors raised in a coroutine #3687

Open
Fingercomp opened this issue Dec 26, 2023 · 1 comment
Open

Coroutine.wrap does not propagate errors raised in a coroutine #3687

Fingercomp opened this issue Dec 26, 2023 · 1 comment
Assignees
Labels
bug OC feature is broken

Comments

@Fingercomp
Copy link
Contributor

The following code should raise an error in the main thread, propagating one thrown by the coroutine body:

print(coroutine.wrap(function()
  error("test")
end)())

print("should be unreachable")

In native Lua and in the BIOS environment none of the print calls are reachable. In OpenOS, however, the wrapper intercepts the error and returns the error object; the code above thus prints the following:

/home/test.lua:2: test
should be unreachable

OC 1.8.3. I think this may be a regression in one of the newer OC versions — I certainly remember coroutine.wrap working as expected a while ago (1.7-ish).

@asiekierka asiekierka added the bug OC feature is broken label Apr 7, 2024
@asiekierka
Copy link
Contributor

This regressed in commit cdfdb277 . Paging @payonel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug OC feature is broken
Projects
None yet
Development

No branches or pull requests

3 participants