mirror of
https://github.com/atom/atom.git
synced 2026-02-14 16:45:14 -05:00
Allow ENOENT errors in project.open
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user