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 handling+better endpoints for http interface #36

Open
yangdanny97 opened this issue Oct 25, 2017 · 0 comments
Open

Better error handling+better endpoints for http interface #36

yangdanny97 opened this issue Oct 25, 2017 · 0 comments

Comments

@yangdanny97
Copy link
Contributor

yangdanny97 commented Oct 25, 2017

For a more robust backend API we should implement this stuff (after all the endpoints are converted to python and completely working, please don't start rewriting halfway through):

  • standardize endpoint naming, remove redundant endpoints (xbox on and xbox off are different endpoints)

  • backend should be able to catch errors and return a response describing what the error is (see below)

  • endpoints should return JSON obj in {status: , body: } format, where status is 200 if request was successful and 500 if there is an error that was caught by backend (this is still treated as a successful request but front end can read the status number and handle it that way). body should be some error message string if status is 500, or some JSON obj if status is 200.

  • write a documentation sheet for endpoints incl response format and example requests

  • write test cases in for backend that simulate requests to the server (ideally the API's should not be manually tested using the GUI, and frontend testing should just be for interface features)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant