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

[WIP] Enhance type mismatch error message #9371

Closed
wants to merge 2 commits into from
Closed

[WIP] Enhance type mismatch error message #9371

wants to merge 2 commits into from

Conversation

herman5
Copy link
Member

@herman5 herman5 commented Mar 23, 2020

Problem

Type mismatches between declared parameter types in yield Gets provide an unclear and overly verbose error message. EG) snapshot = yield Get(Snapshot, PathGlobs, "foo") returns the following:

Exception: WithDeps(Inner(InnerEntry { params: {Console, OptionsBootstrapper, Specs}, rule: Task(Task { product: List, clause: [Select { product: Console }, Select { product: _Options }, Select { product: Specs }], gets: [Get { product: Snapshot, subject: PathGlobs }, Get { product: HydratedTargets, subject: Specs }, Get { product: BuildFileAddresses, subject: Specs }], func: list_targets(), cacheable: false }) })) did not declare a dependency on JustGet(Get { product: Snapshot, subject: str })

Relevant issue: #8349

Solution

The verbose entry and dependencies were replaced with subject instance type, product type, and a path to the offending method:

Exception: Unable to transform from str to Snapshot. See "pants_test.engine.rules:84:pathglobs_to_snapshot()"

@Eric-Arellano
Copy link
Contributor

Closing out as stale - but, we would still love this change so please feel free to reopen if you have some time to work on it :)

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