Use eventType from pathwatcher's watch errors in messages

This commit is contained in:
Ben Ogle
2015-01-14 12:46:31 -08:00
parent 2355862101
commit 3dc908c5ff
2 changed files with 6 additions and 3 deletions

View File

@@ -60,15 +60,18 @@ describe "Project", ->
it "creates a warning notification", ->
atom.notifications.onDidAddNotification noteSpy = jasmine.createSpy()
error = new Error('SomeError')
error.eventType = 'resurrect'
editor.buffer.emitter.emit 'will-throw-watch-error',
handle: jasmine.createSpy()
error: new Error('SomeError')
error: error
expect(noteSpy).toHaveBeenCalled()
notification = noteSpy.mostRecentCall.args[0]
expect(notification.getType()).toBe 'warning'
expect(notification.getDetail()).toBe 'SomeError'
expect(notification.getMessage()).toContain '`resurrect`'
describe ".open(path)", ->
[absolutePath, newBufferHandler] = []

View File

@@ -337,8 +337,8 @@ class Project extends Model
buffer.onWillThrowWatchError ({error, handle}) =>
handle()
atom.notifications.addWarning """
Unable to read file after file change event.
Make sure you have permission to access the file.
Unable to read file after file `#{error.eventType}` event.
Make sure you have permission to access `#{@getPath()}`.
""",
detail: error.message
dismissable: true