Merge pull request #7173 from atom/ns-prompt-on-large-files

Show a warning prompt when opening files over 20MB
This commit is contained in:
Ivan Žužak
2015-06-21 18:17:59 +02:00
3 changed files with 47 additions and 9 deletions

View File

@@ -437,15 +437,16 @@ class Workspace extends Model
item ?= atom.project.open(uri, options)
catch 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 'CANCELLED'
return Q()
when 'EACCES'
atom.notifications.addWarning("Permission denied '#{error.path}'")
return Q()
when 'EPERM', 'EBUSY'
atom.notifications.addWarning("Unable to open '#{error.path}'", detail: error.message)
return Q()
else
throw error
return Q()
Q(item)
.then (item) =>