                Check your network connection and try again."
       buttons: ["OK"]
 
+  _catchFSErrors: (error) ->
+    if error.code in ['EPERM', 'EMFILE', 'EACCES']
+      remote.dialog.showMessageBox
+        type: 'warning'
+        message: "Download Failed"
+        detail: "N1 could not save an attachment. Check that permissions are set correctly and that you have enough disk space.\n\n#{error.message}"
+        buttons: ["OK"]
+      return Promise.resolve()
+    else
+      return Promise.reject(error)
+
 # Expose the Download class for our tests, and possibly for other things someday
 FileDownloadStore.Download = Download

      Promise.all(savePromises)
      .then =>
        shell.showItemInFolder(lastSavePath) if lastSavePath
      .catch =>
        @_presentError(file)


      mkdirpAsync(targetFolder)

  _fetch: (file) ->
    @_runDownload(file)
    .catch(@_catchFSErrors)
    .catch (error) ->
      # Passively ignore

  _fetchAndOpen: (file) ->
    @_runDownload(file).then (download) ->
      shell.openItem(download.targetPath)
    .catch(@_catchFSErrors)
    .catch =>
      @_presentError(file)

