Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Error handling for failed requests #1556

Closed
sujeethk opened this issue Oct 11, 2016 · 2 comments
Closed

Error handling for failed requests #1556

sujeethk opened this issue Oct 11, 2016 · 2 comments

Comments

@sujeethk
Copy link
Contributor

Currently if the user lost his connection or the request timed-out or the server goes down the client controllers do not handle this error as there is no response. Even if error handling is invoked res.data.message is not available, and there would be an angular error posted to the console(which the end user isn't watching). So end user experience is that he clicks a button and waits but nothing happens.

Such a scenario can be handled by adding an error handler for status code -1 and use the ui-notification to show an alert that the response failed.

Thoughts?

@mleanos
Copy link
Member

mleanos commented Oct 11, 2016

SGTM. Can we watch for this error response in our $http Interceptor's implementation? That would be ideal.

@sujeethk
Copy link
Contributor Author

@mleanos Ill make a PR shortly with an implementation I am testing now. It uses the Auth Interceptor.

mleanos pushed a commit that referenced this issue Oct 12, 2016
Add error handle for failed requests(no response from server)
Using Notification.error to show error message
Added test for the notification in Auth Interceptor

Fixes #1556
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants