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

Lwt_main.run throws on exit(1) #758

Closed
Schniz opened this issue Dec 29, 2019 · 1 comment
Closed

Lwt_main.run throws on exit(1) #758

Schniz opened this issue Dec 29, 2019 · 1 comment

Comments

@Schniz
Copy link

Schniz commented Dec 29, 2019

The error it says is Failure "Nested calls to Lwt_main.run are not allowed", which seems like a weird result.

I know that maybe exit(1) is not the "lwt"-ish way but maybe this error should say something else?

context: I got it as an issue in fnm: Schniz/fnm#181
I fixed it with returning a result, instead of exiting, which is probably a better way of doing it.

@aantron
Copy link
Collaborator

aantron commented Dec 29, 2019

Thanks, that was a bug in Lwt_main. The linked commit should fix it. I'll release this next Monday, mainly because there was a release this weekend, and I think I should limit the rate a little :)

Schniz added a commit to Schniz/fnm that referenced this issue Dec 30, 2019
Seems that Lwt 5 throws a weird error when using `exit(1)` inside a
promise. So instead of exiting in the command, making all executable
modules a function that returns a `result((), status_code)` is a better fit.

Relates to: ocsigen/lwt#758
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants