Skip to content

Add [Needs_stack_trace] annotation for user errors#5047

Merged
snowleopard merged 1 commit intoocaml:mainfrom
snowleopard:needs-stack-trace
Oct 25, 2021
Merged

Add [Needs_stack_trace] annotation for user errors#5047
snowleopard merged 1 commit intoocaml:mainfrom
snowleopard:needs-stack-trace

Conversation

@snowleopard
Copy link
Copy Markdown
Collaborator

@snowleopard snowleopard commented Oct 23, 2021

In #5025 that introduces directory targets, I need a way to force a user error to include the stack trace even though it has an embedded location.

This PR makes this possible via the new Needs_stack_trace annotation. I also fix a naming inconsistency and rename has_embed_location to has_embedded_location.

@snowleopard snowleopard requested review from a user, cwong-ocaml and rgrinberg October 23, 2021 10:23
Signed-off-by: Andrey Mokhov <amokhov@janestreet.com>
@snowleopard snowleopard merged commit 5306218 into ocaml:main Oct 25, 2021
@snowleopard snowleopard deleted the needs-stack-trace branch October 25, 2021 10:50
snowleopard added a commit that referenced this pull request Nov 2, 2021
Thanks to #5075 and #5047, we can now easily provide more information for some library
resolution errors. I think it's pretty helpful to tell the user why the problematic library was required.
In fact, in one of the tests, this was suggested as a future improvement.

We could only do this for a subset of errors in this module, but after studying the new error
messages, I think all of them got better.

Signed-off-by: Andrey Mokhov <amokhov@janestreet.com>
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