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

More meaningful message when ~/.rr doesn't exist. #1617

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

szborows
Copy link

Fixes #1583

if (!file_exists(path)) {
fprintf(
stderr,
"rr: warning: No traces have been recorded so far.\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This message might not be true. It might just be that someone did rr replay <path> where <path> is not the name of an rr trace directory.

Also, I think we don't need a separate file_exists check here. If vfile.good() is false then we can assume the file doesn't exist. We should just print a different, better message saying that the trace was not found.

Actually what would be really useful is to change this constructor so that if an error occurs, it returns an error code (an enum) in an out-parameter and the caller can handle it. Then ReplaySession's constructor can forward that error out to its caller, ReplayCommand, which can display the error message. Really the Command classes should be responsible for interacting with the user.

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.

rr ps prints misleading error message when ~/.rr doesn't exist
2 participants