1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 05:19:57 +00:00
TiddlyWiki5/core/modules/savers
Simon Baird 39e4e69ae7
Show server response as error message in put saver (#6589)
* Show server response as error message in put saver

I'd like to use this on Tiddlyhost so users can get more informative
error messages if the put save fails for whatever reason.

This would make the put saver a viable replacement for the legacy
upload saver, which is what Tiddlyhost uses currently.

I'm not sure what standard WebDAV servers do, but I would guess they
don't provide any response body for put requests, and hence this
patch would have no impact for a standard WebDAV server. (That said,
it would be a good idea to test it to make sure there aren't any
unexpected regressions for WebDAV or other put saver compatible
services.)

* Access http response status directly in put saver

There's no need to extract it from the error string created inside
tw.utils.httpRequest if we can get it directly from the xhr object.

* Add 'Save starting' notification for put saver

There are two related changes here:

1. Add a 'Save starting' notification for the put saver, similar to
   the upload saver. Not sure if it was intentionally omitted for
   the put saver, but it seems reasonable to have the two be
   consistent.

2. Send the 'Save starting' notifications in both upload and put
   save right before the actual request is sent. While testing I
   noticed that the save might have failed before the "Save
   starting" notification appeared which doesn't seem useful.
2022-04-05 17:06:56 +01:00
..
andtidwiki.js Adds $tw.utils.decodeURISafe and $tw.utils.decodeURIComponentSafe (#5999) 2021-08-29 13:39:32 +01:00
beaker.js Add write condition for DAT protocol (#3244) 2018-05-02 15:57:47 +01:00
custom.js add override saver (#4908) 2020-10-28 11:58:48 +00:00
download.js Adds $tw.utils.decodeURISafe and $tw.utils.decodeURIComponentSafe (#5999) 2021-08-29 13:39:32 +01:00
fsosaver.js Ensure that savers invoke the callback 2014-08-27 09:59:01 +01:00
gitea.js Introduce JSON parse utility function with error handling (#6401) 2022-02-21 15:29:25 +00:00
github.js Introduce JSON parse utility function with error handling (#6401) 2022-02-21 15:29:25 +00:00
gitlab.js Introduce JSON parse utility function with error handling (#6401) 2022-02-21 15:29:25 +00:00
hyperdrive.js Add saver for Hyperdrive protocol used in Beaker 1.x (#4777) 2020-08-10 20:32:28 +01:00
manualdownload.js Ensure that savers invoke the callback 2014-08-27 09:59:01 +01:00
msdownload.js Ensure that savers invoke the callback 2014-08-27 09:59:01 +01:00
put.js Show server response as error message in put saver (#6589) 2022-04-05 17:06:56 +01:00
tiddlyfox.js Adds $tw.utils.decodeURISafe and $tw.utils.decodeURIComponentSafe (#5999) 2021-08-29 13:39:32 +01:00
tiddlyie.js Ensure that savers invoke the callback 2014-08-27 09:59:01 +01:00
twedit.js Adds $tw.utils.decodeURISafe and $tw.utils.decodeURIComponentSafe (#5999) 2021-08-29 13:39:32 +01:00
upload.js Show server response as error message in put saver (#6589) 2022-04-05 17:06:56 +01:00