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

Build in Support for HTTP status codes and Error Handling #351

Open
shoes22 opened this issue Dec 14, 2017 · 5 comments
Open

Build in Support for HTTP status codes and Error Handling #351

shoes22 opened this issue Dec 14, 2017 · 5 comments

Comments

@shoes22
Copy link

shoes22 commented Dec 14, 2017

I've implemented Smoothstate into our platform, and for the most part it works very well after incorporating a few jquery hacks to not break any existing site functionality. What I would like to have as a native feature in smoothstate is built-in error handling conditions for ajax requests. For example, if the HTTP status code of the requested page is anything besides 200, (like 404, 500, etc.), then allow smoothstate to stop loading the new page, and execute other code instead (like an error message).

In the current behavior, when smoothstate encounters an error, the page will just hang and remain in the loading state indefinitely.

@extricate
Copy link

Definitely support this (came here looking for something like this); might however end up simply writing this myself.

@rupl
Copy link

rupl commented Aug 26, 2019

Having an onError handler would be nice especially for responses like 401/403 where you'd ideally like to transition somewhere, offer an informative message, and maybe a back button.

@extricate
Copy link

@rupl I think by now we ought to move on to bigger and better things, considering this package has basically been unmaintained for at least 3 - 4 years now. Have you met my friend React.JS?

@rupl
Copy link

rupl commented Aug 26, 2019

@extricate yes I agree for new projects I reach for a completely different toolset. However I often work on projects that have legacy codebase. In this case, I don't have authorization to rewrite the whole thing, you know?

I do perceive this library to be unmaintained, but still worth bumping, if only so I can link here within my own code comments and explain my actions (e.g. serving a 200 on what should be a 401 so I can get the thing to work)

@extricate
Copy link

@rupl Fair point. Good luck with the legacy then!

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

3 participants