Update httpInterface.js

This commit is contained in:
Luis Fernando Molina committed 2021-01-10 15:10:32 +01:00
1 parent 37ea4e353e
commit a8b1602fd8
1 file changed
+2
+2
View File
@@ -456,6 +456,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
if (schemaDocument.deleted === true) {
try {
fs.unlinkSync(filePath + '/' + fileName)
console.log('[SUCCESS] ' + filePath + '/' + fileName + ' deleted.')
} catch (err) {
console.log('[ERROR] httpInterface -> Docs -> Save -> ' + filePath + '/' + fileName + ' could not be deleted.')
console.log('[ERROR] httpInterface -> Docs -> Save -> Resolve the issue that is preventing the Client to delete this file. Look at the error message below as a guide. At the UI you will need to delete this page again in order for the Client to retry next time you execute the docs.save command.')
@@ -465,6 +466,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
if (schemaDocument.edited === true || schemaDocument.created === true) {
try {
fs.writeFileSync(filePath + '/' + fileName, fileContent)
console.log('[SUCCESS] ' + filePath + '/' + fileName + ' updated.')
} catch (err) {
console.log('[ERROR] httpInterface -> Docs -> Save -> ' + filePath + '/' + fileName + ' could not be created / updated.')
console.log('[ERROR] httpInterface -> Docs -> Save -> Dont worry, the changes are still at the UI, but you will need to do 2 things: 1) Resolve the issue that is preventing the Client to write this file. Look at the error message below as a guide. 2) At the UI, locate this page and edit it with some small change again, so that is flagged that contains changes, otherwise those original changes will be ignored by the Client during the next docs.save command execution.')