-
Notifications
You must be signed in to change notification settings - Fork 406
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
Show the context name for errors happening in "alt" contexts #10414
Conversation
Signed-off-by: Javier Chávarri <[email protected]>
Signed-off-by: Javier Chávarri <[email protected]>
Signed-off-by: Javier Chávarri <[email protected]>
Signed-off-by: Javier Chávarri <[email protected]>
We're actually trying to get rid of contexts from the engine and make them strictly rule only, so this PR would make it more more difficult for us. I think we pass the directory with some user messages. So you could try extracting in |
Signed-off-by: Javier Chávarri <[email protected]>
Signed-off-by: Javier Chávarri <[email protected]>
@rgrinberg is 63f17d1 what you had in mind? I tried moving the |
Signed-off-by: Javier Chávarri <[email protected]>
Ftr: #7049. |
Signed-off-by: Javier Chávarri <[email protected]>
Signed-off-by: Javier Chávarri <[email protected]>
Signed-off-by: Javier Chávarri <[email protected]>
Signed-off-by: Javier Chávarri <[email protected]>
Signed-off-by: Javier Chávarri <[email protected]>
I'm going to double check this tomorrow, but I think you can just get rid of that annotation and just include |
I tried adding a new field
I don't get it very well because |
I think there's a cycle even without
graph LR
User_error -- User_error.raise --> Path
User_message -- User_error.t --> User_error
|
That's a bit of a pain. I think you can just use a string path though. |
as requested in ocaml#10414 (comment) Signed-off-by: Javier Chávarri <[email protected]>
Signed-off-by: Javier Chávarri <[email protected]>
Tried something in 550d20e. |
Signed-off-by: Javier Chávarri <[email protected]>
Tests are failing for unrelated reason, see #10484. |
Signed-off-by: Javier Chávarri <[email protected]>
@pmwhite can you check if this change is going to work internally? |
@rgrinberg I just wrote a patch to import this PR internally. It mostly applies without changes, except for a few places (e.g. |
Ok, thanks. In general, I'm quite happy to get rid of this "annots" map and just shove things directly into the user error type. Once the internal patch is merged, could you sync this PR with it and we can merge? |
Fixes #10378.
Initially I started looking into adding the changes at a later stage (
Build_cmd
,Report_error
) but at that moment it seems it's already "too late" and I couldn't find a way to get the context where the process is being executed from. In the end I am resortingThe print function doesn't add any new information if the context name is
default
. Maybe there could be some opt-in configuration to enable default logging in all cases added in a future PR cc @davesnx.Given the pervasiveness of
User_message.make
, I assume this initial PR is missing a lot of places where it'd be interesting to print the context name as well. But I thought it'd make things easier for reviewers to start with a small PR, and then follow up later on with other PRs that will include any improvements over it.