From 376db60accabef8da4d9a58b149ece61c495f1bf Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Thu, 30 Aug 2018 09:32:50 +0100 Subject: [PATCH] fix error messages for readonly --- red.js | 7 +++++-- red/runtime/locales/en-US/runtime.json | 2 +- red/runtime/storage/localfilesystem/util.js | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/red.js b/red.js index 9b86357f1..5d5fe397d 100755 --- a/red.js +++ b/red.js @@ -106,8 +106,11 @@ if (parsedArgs.settings) { settingsFile = userSettingsFile; } catch (err) { - console.log("Can't copy settings file. Is file system Read Only ?"); - console.log("You may want to set readOnly: true, in settings.js"); + console.log("Failed to copy settings file to "+userSettingsFile); + console.log("Error: "+err.toString()); + if (err.code == "EACCES") { + console.log("You may need to set readOnly: true, in settings.js"); + } process.exit(1); } } else { diff --git a/red/runtime/locales/en-US/runtime.json b/red/runtime/locales/en-US/runtime.json index d5967c98b..0c1bcdfaf 100644 --- a/red/runtime/locales/en-US/runtime.json +++ b/red/runtime/locales/en-US/runtime.json @@ -142,7 +142,7 @@ "restore": "Restoring __type__ file backup : __path__", "restore-fail": "Restoring __type__ file backup failed : __message__", "fsync-fail": "Flushing file __path__ to disk failed : __message__", - "fwrite-fail": "Writing backup file __path__ to disk failed.", + "fwrite-fail": "Writing backup file __path__ to disk failed : __message__", "projects": { "changing-project": "Setting active project : __project__", "active-project": "Active project : __project__", diff --git a/red/runtime/storage/localfilesystem/util.js b/red/runtime/storage/localfilesystem/util.js index 342b4f950..7ec87911f 100644 --- a/red/runtime/storage/localfilesystem/util.js +++ b/red/runtime/storage/localfilesystem/util.js @@ -84,7 +84,7 @@ module.exports = { try { fs.renameSync(path,backupPath); } catch(e) { - log.warn(log._("storage.localfilesystem.fwrite-fail",{path:path})); + log.warn(log._("storage.localfilesystem.fwrite-fail",{path:path, message:e.toString()})); } } }