Skip to content

TagSpaces is an offline, open source, document manager with tagging support

adding test error handling

uggrock031fc5a8ba5f
diff --git a/data/web/web.api.js b/data/web/web.api.js
index 009411afd..c472df902 100644
--- a/data/web/web.api.js
+++ b/data/web/web.api.js
@@ -234,7 +234,11 @@ define(function(require, exports, module) {
encodeURI(path),
function(status, data, headers) {
console.log("Directory/File Deletion Status/Content/Headers: " + status + " / " + data + " / " + headers);
- TSPOSTIO.deleteElement(path);
+ if(status === 204) {
+ TSPOSTIO.deleteElement(path);
+ } else {
+ TSCORE.showAlertDialog("Deletion of the file failed");
+ }
}
);
};