Bug Fixed y logging

This commit is contained in:
Luis Fernando Molina committed 2021-01-11 11:12:48 +01:00
1 parent fe4e98a772
commit 29a2d71352
1 file changed
+8 -6
+8 -6
View File
@@ -464,18 +464,20 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
} else {
if (schemaDocument.updated === true || schemaDocument.created === true) {
try {
let created = schemaDocument.created
let updated = schemaDocument.updated
schemaDocument.updated = undefined
schemaDocument.created = undefined
let fileContent = JSON.stringify(schemaDocument, undefined, 4)
fs.writeFileSync(filePath + '/' + fileName, fileContent)
if (schemaDocument.created === true) {
if (created === true) {
console.log('[SUCCESS] ' + filePath + '/' + fileName + ' created.')
return
}
if (schemaDocument.updated === true) {
console.log('[SUCCESS] ' + filePath + '/' + fileName + ' updated.')
return
} else {
if (updated === true) {
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.')