-
Notifications
You must be signed in to change notification settings - Fork 332
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
Don't Redirect on Errors #570
Comments
These are errors that are occurring at the isomorphic layer (IE the server has an error before it can send info back to you). So these are basically a It might have history, but I'm not sure. |
I'm not sure what you are trying to say. I agree that the client should show the error in text form. However I think the URL should not be changed to an "error" URL, it should stay at the page that experienced the error. |
Its a server error, so I don't know of a good way to handle it. Example: lets say you are going to a non-existent community. I can't even begin to load the community page, because the lemmy server will correctly give you an API error saying: "community doesn't exist". So I have to redirect before even trying to load that page, to a 404 page. I can't go "back", because it never loaded the community page in the first place. |
I feel like I'm vastly how the Lemmy frontend must work. To me it seems like.
My main question is why can't 4 just be skipped. Just render the error page at the original URL. Is this difficult due to a framework limitation? |
You skipped a step between 1 and 2, lemmy has what's called an isomorphic ui, where there's a ui "server", that builds the page and fetches all the data on the server, and serves up pre built html without needing javascript. That ui server can only do a redirect when it fails to build the page. |
I see. But in that case why can't it just generate a prerendered error page withuot the redirect? |
I agree, its very different when there is some backend error, and you get redirected to some different url. It means you cant just reload, but have to figure out how to get back to the url that you actually wanted to visit. Its even more complicated because it seems to mess up the browser history as well. |
Okay I found a not-as-pretty but clean way to do this. |
Is your proposal related to a problem?
Right now if the server returns an error (for example because the server is a bit loverloaded) you get redirected to a URL like https://lemmy.ml/404?err=FetchError:%20invalid%20json%20response%20body%20at%20http://lemmy:8536/api/v3/user?sort=New&saved_only=false&page=1&limit=20&auth=REDACTED&username=REDACTED%20reason:%20Unexpected%20end%20of%20JSON%20input to display an error message.
This is bad UX because:
Describe the solution you'd like
Just render the error page on the URL that failed to load.
Describe alternatives you've considered
Redirect, but keep the original in the history. But this still isn't as convenient in my opinion.
The text was updated successfully, but these errors were encountered: