Merge pull request #5157 from postcasio/da-handle-erofs

Handle EROFS errors when saving
This commit is contained in:
Ben Ogle
2015-01-20 15:39:19 -08:00
2 changed files with 17 additions and 0 deletions

View File

@@ -631,6 +631,8 @@ class Workspace extends Model
atom.notifications.addWarning("Unable to save file '#{error.path}'", detail: error.message)
else if error.code is 'EBUSY' and error.path?
atom.notifications.addWarning("Unable to save file '#{error.path}'", detail: error.message)
else if error.code is 'EROFS' and error.path?
atom.notifications.addWarning("Unable to save file: Read-only file system '#{error.path}'")
else if errorMatch = /ENOTDIR, not a directory '([^']+)'/.exec(error.message)
fileName = errorMatch[1]
atom.notifications.addWarning("Unable to save file: A directory in the path '#{fileName}' could not be written to")