Fork me on GitHub
#immutant
<
2017-03-21
>
rauh07:03:56

I always get an exception when sending a message to a websocket (server -> client): https://gist.github.com/rauhs/7ec77945f94d7ddd40bb44ed253ba3dc

jumar12:03:03

@rauh it seems that the destructuring in :on-close handler is wrong

(fn [ch & {:keys [code reason]}]
   (swap! channels disj ch))
should probably be
(fn [ch {:keys [code reason]}]
   (swap! channels disj ch))

jumar12:03:44

It helps to look at part of stacktrace saying that:

java.lang.IllegalArgumentException: No value supplied for key: {:code 1001, :reason ""}
	at clojure.lang.PersistentHashMap.create(PersistentHashMap.java:77)
	at srs_s.services.live_reload$handle_request$fn__65888.doInvoke(live_reload.clj:40)
(line 40)

rauh12:03:21

@jumar Thanks! I'm sometimes completely blind 🙂