mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Catch readonly write errors more cleanly
Fail more cleanly when run from a readonly files system without setting readOnly true.
This commit is contained in:
@@ -81,7 +81,11 @@ module.exports = {
|
||||
writeFile: function(path,content,backupPath) {
|
||||
if (backupPath) {
|
||||
if (fs.existsSync(path)) {
|
||||
fs.renameSync(path,backupPath);
|
||||
try {
|
||||
fs.renameSync(path,backupPath);
|
||||
} catch(e) {
|
||||
log.warn(log._("storage.localfilesystem.fwrite-fail",{path:path}));
|
||||
}
|
||||
}
|
||||
}
|
||||
return when.promise(function(resolve,reject) {
|
||||
|
||||
Reference in New Issue
Block a user