mirror of
https://github.com/atom/atom.git
synced 2026-02-14 16:45:14 -05:00
Use the error.code and path in the error
This commit is contained in:
@@ -624,8 +624,8 @@ 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 error.code is 'EACCES' and error.path?
|
||||
atom.notifications.addWarning("Unable to save file: Permission denied '#{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")
|
||||
|
||||
Reference in New Issue
Block a user