From 4b8e98af0cb7833eb95b02839f45ff3735592edb Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Fri, 9 Jan 2015 16:25:00 -0800 Subject: [PATCH] Display a better message when there are config watch errors on startup --- src/config.coffee | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/config.coffee b/src/config.coffee index 721c522ad..bd2e9c5dc 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -832,25 +832,26 @@ class Config @configFileHasErrors = false catch error @configFileHasErrors = true - @notifyFailure('Failed to load config.cson', error) + @notifyFailure('Failed to load config.cson', error.message) observeUserConfig: -> try @watchSubscription ?= pathWatcher.watch @configFilePath, (eventType) => @debouncedLoad() if eventType is 'change' and @watchSubscription? catch error - @notifyFailure('Failed to watch user config', error) + @notifyFailure """ + Unable to watch path: `config.cson`. Make sure you have permissions to + `~/.atom/config.cson`. On linux there are currently problems with watch + sizes. See [this document][watches] for more info. + [watches]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md#typeerror-unable-to-watch-path + """ unobserveUserConfig: -> @watchSubscription?.close() @watchSubscription = null - notifyFailure: (errorMessage, error) -> - message = "#{errorMessage}" - detail = error.stack - atom.notifications.addError(message, {detail, dismissable: true}) - console.error message - console.error detail + notifyFailure: (errorMessage, detail) -> + atom.notifications.addError(errorMessage, {detail, dismissable: true}) save: -> allSettings = {'*': @settings}