Specs for the eacces error

This commit is contained in:
Ben Ogle
2014-12-15 17:42:27 -08:00
parent 265601cbdb
commit f199c71fa8
2 changed files with 11 additions and 1 deletions

View File

@@ -571,9 +571,11 @@ class Workspace extends Model
catch error
if error.message.endsWith('is a directory')
atom.notifications.addWarning("Unable to save file: #{error.message}")
else if error.message.startsWith('EACCES,')
atom.notifications.addWarning("Unable to save file: #{error.message.replace('EACCES, ', '')}")
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.")
atom.notifications.addWarning("Unable to save file: A directory in the path '#{fileName}' could not be written to")
else
throw error