Add error handling for EBUSY as well

This commit is contained in:
Ben Ogle
2015-01-16 11:07:32 -08:00
parent 2577843e51
commit 11bda1b47a
2 changed files with 34 additions and 1 deletions

View File

@@ -458,6 +458,8 @@ class Workspace extends Model
atom.notifications.addWarning("Permission denied '#{error.path}'")
when 'EPERM'
atom.notifications.addWarning("Unable to open '#{error.path}'", detail: error.message)
when 'EBUSY'
atom.notifications.addWarning("Unable to open '#{error.path}'", detail: error.message)
else
throw error
return Q()
@@ -629,6 +631,8 @@ class Workspace extends Model
atom.notifications.addWarning("Unable to save file: Permission denied '#{error.path}'")
else if error.code is 'EPERM' and error.path?
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 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")