       throw new Error('Missing "type". found keys', Object.keys(r))
 
   return results
+
+showError = (error) ->
+  atom.notifications.addError "#{error.message}", {detail: error.stack, dismissable: true}
+  return []
 
 class EditorLinter
   constructor: (@linter, @editor) ->

        # catch any exceptions thrown by `linter.lint`
        resolve(linter.lint(@editor, @buffer))
      ).then(validateResults)
      .then((results) =>
        if linter.scope is 'project' then @linter.messagesProject.set linter, results
        else @messages.set linter, results
      ).catch((error) =>
        if linter.scope is 'project' then @linter.messagesProject.delete linter
        else @messages.delete linter
        atom.notifications.addError "#{error.message}", {detail: error.stack, dismissable: true}
      ).then(=> # finally
        @emitter.emit 'did-update'
        @linter.view.render() if @editor is @linter.activeEditor
      )

  progress: (onChange, newValue) ->
    if typeof newValue is 'undefined'
      if onChange
        return @inProgressFly
      else
        return @inProgress
    else
      if onChange
        @inProgressFly = newValue
      else
        @inProgress = newValue

  destroy: ->
    @emitter.emit 'did-destroy'

    )

  lint: (onChange) ->
    return if @editor isnt @linter.activeEditor

    # When linting is triggered by a save we need to also run back through and
    # run the linters that trigger on the fly.
    if not onChange
      @lint true

    @_promiseLock(onChange, =>
      scopes = @editor.scopeDescriptorForBufferPosition(@editor.getCursorBufferPosition()).scopes
      scopes.push '*' # Ensure that everything can be linted with a wildcard.
      return Promise.all(@lintResults(onChange, scopes))
    )
    undefined

  lintResults: (onChange, scopes) ->
    return @linter.linters.map (linter) =>
