From 477801ba52b784e6d898529b73fc4b138fa66cd9 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 5 Feb 2015 14:43:45 -0800 Subject: [PATCH] Remove save error reporting from Workspace --- src/workspace.coffee | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/workspace.coffee b/src/workspace.coffee index 315fa7e94..b2fc6fbf1 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -609,7 +609,7 @@ class Workspace extends Model # {::saveActivePaneItemAs} # will be called instead. This method does nothing # if the active item does not implement a `.save` method. saveActivePaneItem: -> - @saveActivePaneItemAndReportErrors('saveActiveItem') + @getActivePane().saveActiveItem() # Prompt the user for a path and save the active pane item to it. # @@ -617,27 +617,7 @@ class Workspace extends Model # `.saveAs` on the item with the selected path. This method does nothing if # the active item does not implement a `.saveAs` method. saveActivePaneItemAs: -> - @saveActivePaneItemAndReportErrors('saveActiveItemAs') - - saveActivePaneItemAndReportErrors: (method) -> - try - @getActivePane()[method]() - catch error - if error.message.endsWith('is a directory') - atom.notifications.addWarning("Unable to save file: #{error.message}") - else if error.code is 'EACCES' and error.path? - 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 error.code is 'EROFS' and error.path? - atom.notifications.addWarning("Unable to save file: Read-only file system '#{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") - else - throw error + @getActivePane().saveActiveItemAs() # Destroy (close) the active pane item. #