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

handle unexpected 404s in utils/request.js #101

Open
gr2m opened this issue Jul 14, 2016 · 3 comments
Open

handle unexpected 404s in utils/request.js #101

gr2m opened this issue Jul 14, 2016 · 3 comments

Comments

@gr2m
Copy link
Member

gr2m commented Jul 14, 2016

in utils/request.js, we expect response.body to be an object with a errors array property. In some circumstances there might be an issue with that, and we should add a check if response.body.errors exists and if it doesn’t, response.body can be a string like Not found: /hoodie/account/api/session/account.

@gr2m
Copy link
Member Author

gr2m commented Jul 14, 2016

It should probably return a generic connection error saying that the account backend cannot be reached, as clearly the server does not respond as expected

@thomasjinlo
Copy link
Contributor

Hey I would like to tackle this issue and was looking into this. I was wondering if there is a way to reproduce this error message?

@gr2m
Copy link
Member Author

gr2m commented Oct 10, 2016

Hey @thomasjinlo, unfortunately not, it’s been a while. You could probably simulate it with a test in which you mock a server response. Problem are these lines: https://github.com/hoodiehq/hoodie-account-client/blob/9b22171/utils/request.js#L26-L29

We don’t check if response.body.errors actually exists.

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

2 participants