          :body (:public-message t)})
       (catch Object e
         (log/error e)
+        (.printStackTrace e)
         {:status 500
          :body "Sorry, something completely unexpected happened!"}))))
 

          @(d/transact (pcd/conn) [{:db/id document-id :document/name "Untitled"}])
          (redirect (str "/document/" document-id))))
   ;; Group newcomers into buckets with bucket-count users in each bucket.
   ;; TODO: exclude documents that didn't start out as buckets.
   (GET ["/bucket/:bucket-count" :bucket-count #"[0-9]+"] [bucket-count]
        (let [bucket-count (Integer/parseInt bucket-count)]
          (if-let [eid (ffirst (sort-by (comp - count last)
                                        (filter (fn [[doc-id subs]]
                                                  (< (count subs) bucket-count))
                                                @sente/document-subs)))]
            (redirect (str "/document/" eid))
            (redirect "/"))))
   (GET "/interesting" []
        {:status 200
         :body (str

  (:require [cemerick.url :as url]
            [cheshire.core :as json]
            [clojure.core.async :as async]
            [clojure.set :as set]
            [clojure.tools.logging :as log]
            [clojure.tools.reader.edn :as edn]
            [clj-time.core :as time]
