mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Use eventType from pathwatcher's watch errors in messages
This commit is contained in:
@@ -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] = []
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user