                     @results_view.render_metadata @current_results.length, 0, @count_results, execution_time, @query
                     @last_completed_query = @query
                     @last_executed_count_results = @count_results
+            error_callback = (err) =>
+                if id is @last_id
+                    @.$('.loading_query_img').css 'display', 'none'
+                    @.results_view.render_error(@query, err)
+
 
 
             iter: iter_callback
             last: last_callback
+            error: error_callback
 
         execute_query: =>
             clearTimeout @timeout


            @.$('.loading_query_img').css 'display', 'block'

            full_query = @query+'\n'+'.iter({callback: iter_callback, doneCallback:last_callback})' # The new line is added in case the last one has an inline comment (//)
            try
                callbacks = @create_tagged_callbacks()
                iter_callback = callbacks.iter
                last_callback = callbacks.last
                @start_time = new Date()
                eval(full_query)
            catch err


            try
                that = @
                r.connect server
                if data? and data.reconnecting is true
                    @.$('#user-alert-space').html @alert_reconnection_success_template({})
            catch err
