From 6211f7330f27355df806e83d2aefce59abc81394 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Wed, 14 Jan 2015 11:14:56 -0800 Subject: [PATCH] Use path name in config error messsages --- src/config.coffee | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/config.coffee b/src/config.coffee index 415c6d2e2..6aa67c008 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -832,10 +832,17 @@ class Config @configFileHasErrors = false catch error @configFileHasErrors = true - if error.location? - @notifyFailure('Failed to load config.cson', error.stack) + fileName = path.basename(@configFilePath) + message = "Failed to load `#{fileName}`" + + detail = if error.location? + # stack is the output from CSON in this case + error.stack else - @notifyFailure('Failed to load config.cson', error.message) + # message will be EACCES permission denied, et al + error.message + + @notifyFailure(message, detail) observeUserConfig: -> try @@ -843,8 +850,8 @@ class Config @debouncedLoad() if eventType is 'change' and @watchSubscription? catch 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 + Unable to watch path: `#{path.basename(@configFilePath)}`. Make sure you have permissions to + `#{@configFilePath}`. 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 """