Allow ENOENT errors in project.open

This commit is contained in:
Ben Ogle
2015-01-13 14:19:27 -08:00
parent cbd42ac20c
commit 3454249b58
3 changed files with 17 additions and 17 deletions

View File

@@ -451,14 +451,13 @@ class Workspace extends Model
try
item ?= atom.project.open(uri, options)
catch error
if error.code is 'EFILETOOLARGE'
atom.notifications.addWarning("#{error.message} Large file support is being tracked at [atom/atom#307](https://github.com/atom/atom/issues/307).")
else if error.code is 'ENOENT' and error.path?
atom.notifications.addWarning("No such file '#{error.path}'")
else if error.code is 'EACCES' and error.path?
atom.notifications.addWarning("Permission denied '#{error.path}'")
else
throw error
switch error.code
when 'EFILETOOLARGE'
atom.notifications.addWarning("#{error.message} Large file support is being tracked at [atom/atom#307](https://github.com/atom/atom/issues/307).")
when 'EACCES'
atom.notifications.addWarning("Permission denied '#{error.path}'")
else
throw error
return Q()
Q(item)