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

status codes in handlers #38

Open
starsuit opened this issue Aug 9, 2019 · 1 comment
Open

status codes in handlers #38

starsuit opened this issue Aug 9, 2019 · 1 comment

Comments

@starsuit
Copy link

starsuit commented Aug 9, 2019

res.writeHead(200, { "Content-Type": "text/html" });

this probably shouldn't be a status code of 200 as we're handling an error here so something is definitely not ok! I'm not too sure right now but it might be a 500 (internal server error). Try this site for cat lists of the error codes! https://http.cat/

@starsuit
Copy link
Author

starsuit commented Aug 9, 2019

to add to this you probably should have some kind of error handling in the getDataHandler function in the same file - if something goes wrong getting the data it's probably good to display an appropriate message

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