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

Propagate errors through map #3151

Merged
merged 4 commits into from
May 13, 2024
Merged

Conversation

peterebden
Copy link
Member

@peterebden peterebden commented May 13, 2024

This is a nicer version of #3150; it should fix the same problem in a more principled way.

Repeating the context here:

  • I have subincludes //a and //b, both of which are preloaded.
  • //a contains subinclude("//b").
  • //b contains a syntax error

We never exit from RegisterPreloads; the errgroup has the error from //b but is waiting for //a to complete, which it never does.

This fixes it by propagating the error through the map where the caller is waiting, so they can receive it too; it extends it from "get the thing or wait" to "get the thing or the error, or wait". I think this should be a more generic solution to this kind of thing overall.

@peterebden peterebden requested a review from Tatskaari May 13, 2024 10:28
@peterebden peterebden changed the title Cerrmap Propagate errors through map May 13, 2024
@peterebden peterebden merged commit 1d892e2 into thought-machine:master May 13, 2024
14 checks passed
@peterebden peterebden deleted the cerrmap branch May 13, 2024 14:15
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

Successfully merging this pull request may close these issues.

2 participants