        (update-regions!)
        (json-response {})))
 
-(defn wrap-exception [handler]
+(defn wrap-exception
+  "Ring middleware that catches the exception and turn it into 500 response"
+  [handler]
   (fn [request]
     (try
       (handler request)

         (response json#)))))

(defn strip-zookeeper-quorum
  [zk]
  (->> (str/split zk #",")
       (map #(first (str/split % #"[:\.]")))

    (util/info (format "  http://%s:%d" ip port)))
  (run-jetty app {:port port}))

(defn exit
  "Prints the message and terminates the program"
  [message]
  (println message)
  (println
    (str/join
