Does yada use the modification date on static files to force browsers to reload? (say for my app.js)
From memory yes
@malcolmsparks Thoughts on transmitting metadata being breaking behavior?
I’m returning this in a yada response function:
(d/chain (http/get source-url)
:body
bs/to-string
#(scraper/select1 % "title")
scraper/text
(fn [title]
(if (not= "Login Page" title)
title
(throw (ex-info (str "Could not fetch Confluence page for id " id)
{:status 400})))))
What this does is get the title from some remote page, if it’s “Login Page” I throw an error. I get the right error code in the browser. But after a few of such requests, it seems that the application hangs. Should I handle this in a different way?For some reason I had to add this kind of error handling:
(defn realize-body
[ex-data]
(if-let [body (:body ex-data)]
(assoc ex-data :body (slurp body))
ex-data))
(d/catch clojure.lang.ExceptionInfo
(fn [^java.lang.Exception ex]
(let [d (ex-data ex)
d (realize-body d)]
(throw (ex-info (.getMessage ex) d)))))
and then it worksOne of these aleph gotchas I guess
Seems like yada could be more helpful with its handling of failed deferreds.
If you forget to realize the body of an aleph response in case of an exception, weird things happen