Add custom notification for ENOSPC save errors

Closes #5825
This commit is contained in:
Kevin Sawicki
2015-03-03 13:53:18 -08:00
parent bb9d264e0c
commit 3952831ff1

View File

@@ -683,6 +683,8 @@ class Pane extends Model
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 error.code is 'ENOSPC' and error.path?
atom.notifications.addWarning("Unable to save file: No space left on device '#{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")