       if location.search and location.search isnt '?q='
         @model = searchResults.load(location.search)
 
+      @listenTo(@model, 'change:error', @displayError)
+
     regions:
       search: '.search'
 

define (require) ->
  searchResults = require('cs!models/search-results')
  BaseView = require('cs!helpers/backbone/views/base')
  AdvancedSearchView = require('cs!./advanced/advanced')

        @regions.search.show(new SearchResultsView({model: @model}))
      else
        @regions.search.show(new AdvancedSearchView())

    displayError: () ->
      error = arguments[1] # @model.get('error')
      router.appView.render('error', {code: error}) if error
