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

4xx errors not caught #49

Closed
chrysn opened this issue Oct 3, 2019 · 2 comments
Closed

4xx errors not caught #49

chrysn opened this issue Oct 3, 2019 · 2 comments
Assignees
Milestone

Comments

@chrysn
Copy link
Contributor

chrysn commented Oct 3, 2019

When a filedirectory comes back 403, the "changing the folder" spinner stays on and the console reports

XML Parsing Error: mismatched tag. Expected: </hr>.
Location: http://my-host/a-forbidden-directory
Line Number 6, Column 3:

To me it looks like there go wrong two things:

  • The returned media type is not text/xml but text/html, but parsing it as directory listing XML is still attempted.
  • The returned representation came back on a 4xx code, indicating the response is an error and not a representation of the requested resource, and parsing is still attempted.

I think the desirable behavior would be to show some (probably modal) error message, possibly even an iframe(-ish? are they still a thing?) representation of the HTML response.

edit: I tested this originally on directories but mistyped it as files. Correcting that I tested it on files as well, and they could probably use the same fixes, given that a 403 HTML file displays the error message (syntax highlit -- cool!) and tries to play the media.

@dom111
Copy link
Owner

dom111 commented Oct 3, 2019

Yeah, this is a good shout. I think I'd like to add some sort of toast/notification to all errors and with the restructuring it should be easy to just add a .catch to the fetch for all failures identifying what failed and why. I'll do this for 2.0 0 too.

Thanks for resting!

@dom111 dom111 self-assigned this Oct 3, 2019
@dom111 dom111 added the bug label Oct 3, 2019
@dom111 dom111 added this to the 2.0.0 milestone Oct 3, 2019
dom111 added a commit that referenced this issue Nov 8, 2019
UI from the core functionality.

- Rewote code and organised into ES modules.
- Remove jQuery dependency (#30).
- Add keyboard navigation.
- Switch WebDAV test container to Alpine Linux.
- Add `eslint` for code style validation.
- Add `karma`/`jasmine` for testing.
- Add `.babelrc`.
- Add some basic unit tests.
- Rework `package.json` scripts.
- Add `Webpack` for building.
- Remove inlined external assets to resolve as module dependencies.
- Update document title on navigation
- Add toasts to notify of errors (#49).
- Add `.gitattributes` file to avoid CSS being counted incorrectly on
  GitHub.
- Add `EventObject` class for handling events within the UI.
- Add a check (`HEAD` request) before trying to show images, fonts,
  videos, audio to prevent invalid lightbox from showing up.
- Update `.editorconfig`.
- Add `stylelint`.
@dom111
Copy link
Owner

dom111 commented Nov 22, 2019

This should be fixed in v2.0.0

@dom111 dom111 closed this as completed Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants