This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-07
Channels
- # announcements (35)
- # beginners (80)
- # boot (1)
- # calva (4)
- # cider (33)
- # cljdoc (40)
- # clojars (3)
- # clojure (95)
- # clojure-berlin (2)
- # clojure-europe (4)
- # clojure-italy (28)
- # clojure-nl (2)
- # clojure-seattle (1)
- # clojure-serbia (1)
- # clojure-spec (74)
- # clojure-uk (71)
- # clojurescript (29)
- # core-async (1)
- # cursive (80)
- # data-science (4)
- # datomic (17)
- # duct (75)
- # emacs (4)
- # figwheel-main (5)
- # fulcro (3)
- # jackdaw (1)
- # java (1)
- # jobs-discuss (20)
- # off-topic (32)
- # parinfer (2)
- # pathom (23)
- # re-frame (26)
- # reagent (25)
- # rum (6)
- # shadow-cljs (122)
- # speculative (4)
- # sql (17)
- # testing (7)
- # yada (8)
Does yada use the modification date on static files to force browsers to reload? (say for my app.js)
đź‘Ť 5
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 works