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 error handling for frontend-API connectivity #15

Open
dabreese00 opened this issue Oct 16, 2021 · 0 comments
Open

Improve error handling for frontend-API connectivity #15

dabreese00 opened this issue Oct 16, 2021 · 0 comments

Comments

@dabreese00
Copy link
Owner

Currently, the frontend doesn't provide much useful debugging info when it fails to fetch the data it wanted from the API.

How to reproduce

  1. Create an empty development database and run the migrations.
  2. Do not create an admin account in the backend, so that the frontend won't be able to authenticate.
  3. Start the backend and frontend servers.

Actual behavior

The frontend server will crash and log to the console. The logged message will just say "Retrieving games failed", with no further info.

But, you can see in the Django logs that it's dishing out HTTP 401/400 responses to the frontend.

Expected behavior

We should ideally be able to tell from the logged frontend error, which of the following happened:

  • Did not get any HTTP response from the API
  • Got an HTTP 400 or other error response from the API
  • Got an HTTP 200 or other success response, but the data received was invalid/unexpected
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