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

exception text: clarify error message #4339

Merged
merged 1 commit into from
Aug 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions dvc/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,11 @@ def __init__(self, target_infos, stats=None):
self.stats = stats
targets = [str(t) for t in target_infos]
m = (
"Checkout failed for following targets:\n{}\nDid you "
"forget to fetch?".format("\n".join(targets))
"Checkout failed for following targets:\n{}\nIs your "
"cache up to date?\n{}".format(
Comment on lines +271 to +272
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cache question seems unclear, how about just:

Suggested change
"Checkout failed for following targets:\n{}\nIs your "
"cache up to date?\n{}".format(
"Checkout failed for following targets:\n{}\n"
"Visit {} for more info.".format(

?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Visit {} for more info." sounds like holding a user hostage. We do need better exception message, which can be done by making _fetch and _checkout collaborate with each other, but making CheckoutError message generic is not a solution, it only adds confusion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skshetry Good point. Maybe for a lack of better message (because a more advanced approach is needed), let's just append "Vinit {} for more info"(or someting like that) to the old message? Just in the interest of time, since the proper-proper solution will require quite a bit more effort.

Copy link
Contributor Author

@bobertlo bobertlo Aug 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@efiop I was sort of thinking the same thing myself. I updated it to that and removed the "Fixes #4316" since that issue goes deeper than this. I think other changes are unrelated to this PR at this point?

Also I should note the link is live on dvc.org now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@efiop, yeah, that sounds good. But let's keep the issue open.

"\n".join(targets),
format_link("https://error.dvc.org/missing-files"),
)
)
super().__init__(m)

Expand Down