         (catch SQLException e
           (log/error (format-sql-exception e)))))))
 
-(defn- check-interrupt [curr-query-no]
+(defn- check-interrupt
+  "Throw an exception if an interrupt (signal) has occured or if queries are out
+  of order."
+  [curr-query-no]
   (let [ieq @interrupt-execute-query]
     (log/debugf "check interrupt: ieq=%s, query no: (%s == %s)"
                 ieq curr-query-no @query-no)

    {:header header
     :rows (if (empty? rows) [{}] rows)}))

(defn- display-result-set [rs meta]
  (try
    (if (conf/config :gui)
      (binding [dis/frame-factory-fn

          throw))))

(defn- execute-query-nowait
  "Execute SQL `query` using optional `query-handler-fn` function with the
  results."
  ([query]
   (execute-query-nowait query nil))
  ([query query-handler-fn]
