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

File Not Found should produce a 404, not a 500 #1

Closed
technosophos opened this issue Jun 4, 2021 · 2 comments
Closed

File Not Found should produce a 404, not a 500 #1

technosophos opened this issue Jun 4, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@technosophos
Copy link
Collaborator

There is a known limitation in Grain 0.3 (which will be fixed in 0.4) that causes File.pathOpen to cause a WASI error that cannot be trapped by userland code.

When Grain 0.4 is released, File.pathOpen will return a Result, which we can trap and convert to a 404 error.

@technosophos technosophos added the bug Something isn't working label Jun 4, 2021
@technosophos
Copy link
Collaborator Author

As a stopgap, it might be possible to do a directory listing of the parent directory and see if the file is there. If not, return a 404 well before the pathOpen is called.

@technosophos
Copy link
Collaborator Author

Closed by #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant