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

Improve the error message for a missing file #43

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PeterJCLaw
Copy link
Owner

@PeterJCLaw PeterJCLaw commented Dec 21, 2024

This now attempts to detect misplaced files and provide suggestions about how to resolve the problem if such files are found.

Previously it would have been like:

ZIP file must contain a file named exactly 'robot.py'.

Found the following files:
 face.py
 sub/robot.py

Now would be like:

ZIP file must contain a file named exactly 'robot.py'.

Found the following files:
 face.py
 sub/robot.py

It looks like you have included a similar file at 'sub/robot.py', perhaps you meant to include that file at 'robot.py' rather than within 'sub/'?

This now attempts to detect misplaced files and provide suggestions
about how to resolve the problem if such files are found.
@PeterJCLaw
Copy link
Owner Author

@ShadowLord2005 would be good to get your thoughts on the error message here.

@ShadowLord2005
Copy link

It looks like it should be alright however do you have some example archives and what they actually output to just see how it reads when looking at a folder structure alongside it?

@PeterJCLaw
Copy link
Owner Author

The example messages are for an archive with two files -- one in the root called face.py and a robot.py which is within a folder called sub. Hrm, your question suggests that perhaps that part of the message could be clearer though 🤔

@ShadowLord2005
Copy link

Ok, that wasn't what I was thinking it did however it could be that it is clearer with a structure to look at. I think the first part of the message is that is says it couldn't find the file robot.py and then a list of all files that it found.
It was the specific error message that was confusing.
What exactly is the single specific error message trying to achieve?

@PeterJCLaw
Copy link
Owner Author

In case useful, here's the archive I used for testing: my.zip

@PeterJCLaw
Copy link
Owner Author

What exactly is the single specific error message trying to achieve?

I'm not sure what you mean by "single specific error message". The goal here is to help the user understand what's wrong with the archive they've tried to submit for their code, by adding some guidance for what I believe is the most common error people make -- putting their code in a folder inside the archive rather than just in the root.

@ShadowLord2005
Copy link

Right, I was thinking that you were going to be doing more case specific error messages.

@PeterJCLaw
Copy link
Owner Author

Oh, I see. If there's other potential causes for why the file might be missing that we can detect I'm up for adding those too. (Though I can't think of any right now)

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