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

Unfriendly error messages for missing files/directories #4

Open
kalekundert opened this issue May 23, 2019 · 0 comments
Open

Unfriendly error messages for missing files/directories #4

kalekundert opened this issue May 23, 2019 · 0 comments

Comments

@kalekundert
Copy link
Owner

kalekundert commented May 23, 2019

Workspaces and experiment directories are defined by meeting certain requirements: having a name that matches a certain pattern, having certain subdirectories, containing certain files, etc.

When these requirements are not met, the error messages are not helpful. In the case of workspaces, it just says "this is not a workspace". In the case of experiments, it just doesn't find the experiment in question (and may find none at all), which leads to some confusing errors.

I was able to trigger a bunch of this behavior by cloning a workspace on a remote server. The workspace wasn't detected initially because none of the empty directories were cloned, so I had to make those directories manually. Maybe the root of the workspace should be defined only by the presence of the .exmemorc file. Exmemo does probably assume that all those directories exists, but I could probably just check for them as needed, and either fail gracefully or create them on-the-fly.

The experiment I had made also wasn't detected because I'd committed some of the files in the experiment, but not the *.rst file. Experiments are detected by (i) being a directory, (ii) prefixed with a date, (iii) containing an *.rst file with a name matching the directory. So without the *.rst file, the experiment wasn't detected. In this case, 'm not so sure what the best course of action is:

  • Maybe I could improve the error message somehow, i.e. detect if a directory with the right name would match, but is just missing its *.rst file. That would at least tell the user what to do.

  • I could add another kind of dot-file to identify experiments (i.e. either one in each experiment, or one in the experiment root that serves as an index), but it would be just as easy to not commit that file too. It would also require the user to manage a magic file that they don't really understand, and it would clutter up their directories. I don't think this is a good idea.

  • I could relax the requirements and consider any date-prefixed directory to be an experiment. One problem I can see with this is that exmemo would like to know the name of the *.rst file for each experiment, so it can open it up when you ask for it. Right now this always works, because the file and the directory have to have the same name (excluding the date prefix). If I get rid of this requirement, I'd have to guess at the name of the *.rst file, although in most cases I could probably guess right.

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

No branches or pull requests

1 participant