                 (catch Exception e
                   {:return-a-500 true
                    :exception (str e)}))]
-          (cond (nil? gcacs)
+          ;; at this point q-and-a is either:
+          ;; - nil: the (wait) timed out; meaning the
+          ;; system is either over-capacity (CPU-starved)
+          ;; or the underlying algorithm is simply not
+          ;; efficient with the supplied inputs.
+          ;; - {:return-a-500 true} The generation attempt
+          ;; threw an exception of some kind, the value of
+          ;; which is available in the :exception key.
+          (cond (nil? q-and-a)
 
                 ;; Avoid any logging here since it will further
                 ;; slow down system since it's already overloaded.

                 :body (write-str {:message "Capacity overload: please try again later."
                                   :spec target-spec})}

                (= true (:return-a-500 gcacs))
                (do
                  (log/error (str "Internal error: returning 500. Exception was:"
                                  (:exception gcacs)))
                  {:status 500
                   :headers {"Content-Type" "application/json;charset=utf-8"}
                   :body (write-str {:message "Unexpected internal error. Sorry: hopefully a human will work on it."})})
                
                true
                (let [source (:source gcacs)
                      targets (:targets gcacs)]
                  (log/info (str "returning normal response:"
                                 "'" source "'"
                                 " -> " targets "; spec:" target-spec))

              target-spec (json-read-str
                           (if-let [target-spec (get (:query-params request) "target-spec")]
                             target-spec "{}"))
              q-and-a
              (try
                (wait wait-ms-for-question
                      (fn []
