-
Notifications
You must be signed in to change notification settings - Fork 414
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
Unify and simplify the error handling #4718
Unify and simplify the error handling #4718
Conversation
b1ddd1d
to
42fdd3b
Compare
…eption instead of inspecting the scheduler state. Signed-off-by: Arseniy Alekseyev <[email protected]>
42fdd3b
to
7266e18
Compare
Signed-off-by: Arseniy Alekseyev <[email protected]>
to unify the two sides. Signed-off-by: Arseniy Alekseyev <[email protected]>
7266e18
to
a206c8e
Compare
@rgrinberg, I borrowed ideas from #4716, but going somewhat further and doing some clean-up of the |
Signed-off-by: Arseniy Alekseyev <[email protected]>
Well, my version of |
Signed-off-by: Arseniy Alekseyev <[email protected]>
Looks good. Could you also implement sending |
@rgrinberg, as I said on that PR, I don't understand why that change is necessary or why it's implemented that way. |
match exn.exn with | ||
| Scheduler.Run.Build_cancelled -> true | ||
| Memo.Error.E err -> ( | ||
match Memo.Error.get err with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid dealing with the optional wrapping, we could change Memo
as follow:
- make
handle_error_no_raise
take aMemo.Error.t
and a backtrace rather than anExn_with_backtrace.t
- make
Memo.Build.run*
only raiseMemo.Error.E
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is already the case that the top-level Memo.Build.run*
only ever raise Memo.Error.E
. We could probably make them return it instead of raising it, even.
For the first bullet-point, agreed. I was even thinking of including the backtrace into Memo.Error.t
, but that's a separate idea.
(I'm assuming you're saying these as ideas for the future PRs, so I'm merging this one)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look correct to me and the resulting code looks simpler.
@rgrinberg, I'm merging it because I want it to simplify the other PR. I hope it doesn't break the RPC. |
This PR does the following:
report_error
callbacks whose purpose was to check if we're being cancelled.Scheduler.poll
toBuild_system.run
so that we don't have to keep synchronizing the two modules on how they handle errors.Build_system.run
, not by the top-level handler in bin/main.ml, which seems like a good unification.Signed-off-by: Arseniy Alekseyev [email protected]