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

Better error message for tile 404s if header/dirs are cached. #122

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

bdon
Copy link
Member

@bdon bdon commented Jan 27, 2024

if err != nil {
return 500, http_headers, []byte("Network error")
return 404, http_headers, []byte("Archive not found")
Copy link
Contributor

@msbarry msbarry Jan 27, 2024

Choose a reason for hiding this comment

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

Could we pass through the actual error? Or at least log it. Also is archive missing the only kind of failure here? Up above I see it does 404 or 500 based on the if it's found or if an error occurred.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't want to expose internal error messages over HTTP, many servers will be public facing.

Let me dig more into the failure scenarios where gocloud returns an error

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok that makes sense. Maybe if we just log the error then like if there's an error getting a directory?

@bdon bdon merged commit d2d9f27 into main Jan 29, 2024
4 checks passed
@bdon bdon deleted the serve-error-messages branch January 29, 2024 03:24
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