Skip to content
Snippets Groups Projects
Commit 82d2ba04 authored by Cam Saül's avatar Cam Saül
Browse files

Merge pull request #2250 from metabase/more-useful-error-message

More useful error message if index.html is missing when running `lein ring server`
parents 5c9a3a50 24687f49
No related branches found
No related tags found
No related merge requests found
......@@ -176,13 +176,13 @@
(defn- post-process-native
([^QueryResponse response]
(post-process-native response 15))
(post-process-native response 20))
([^QueryResponse response, ^Integer timeout-seconds]
(if-not (.getJobComplete response)
;; 99% of the time by the time this is called `.getJobComplete` will return `true`. On the off chance it doesn't, wait a few seconds for the job to finish.
(do
(when (zero? timeout-seconds)
(throw (ex-info query-timeout-error-message response)))
(throw (ex-info query-timeout-error-message (into {} response))))
(Thread/sleep 1000)
(post-process-native response (dec timeout-seconds)))
;; Otherwise the job *is* complete
......
......@@ -10,7 +10,8 @@
(defn- index [_]
(-> (if (@(resolve 'metabase.core/initialized?))
(stencil/render-string (slurp (io/resource "frontend_client/index.html"))
(stencil/render-string (slurp (or (io/resource "frontend_client/index.html")
(throw (Exception. "Cannot find './resources/frontend_client/index.html'. Did you remember to build the Metabase frontend?"))))
{:bootstrap_json (json/generate-string (setting/public-settings))})
(slurp (io/resource "frontend_client/init.html")))
resp/response
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment