From 2007ddf0bada9b13744b0d7e5c65e98b291cb44c Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Tue, 22 Mar 2016 16:37:24 -0700 Subject: [PATCH] fix(attachments): Add warning for ENOSPC as well --- src/flux/stores/file-download-store.coffee | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/flux/stores/file-download-store.coffee b/src/flux/stores/file-download-store.coffee index 3740f997d..35d918e8c 100644 --- a/src/flux/stores/file-download-store.coffee +++ b/src/flux/stores/file-download-store.coffee @@ -298,11 +298,17 @@ FileDownloadStore = Reflux.createStore buttons: ["OK"] _catchFSErrors: (error) -> + message = null if error.code in ['EPERM', 'EMFILE', 'EACCES'] + message = "N1 could not save an attachment. Check that permissions are set correctly and try restarting N1 if the issue persists." + if error.code in ['ENOSPC'] + message = "N1 could not save an attachment because you have run out of disk space." + + if message 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}" + detail: "#{message}\n\n#{error.message}" buttons: ["OK"] return Promise.resolve() else