This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-24
Channels
- # announcements (6)
- # babashka (25)
- # beginners (52)
- # cherry (8)
- # cider (9)
- # clj-kondo (9)
- # clojure (44)
- # clojure-australia (5)
- # clojure-dev (4)
- # clojure-europe (8)
- # clojure-nl (5)
- # clojure-norway (3)
- # clojure-spec (3)
- # clojure-uk (1)
- # clojurescript (16)
- # conjure (1)
- # core-async (8)
- # cursive (11)
- # fulcro (13)
- # honeysql (6)
- # hyperfiddle (13)
- # jackdaw (1)
- # jobs (9)
- # lsp (13)
- # meander (5)
- # missionary (2)
- # off-topic (11)
- # polylith (11)
- # re-frame (2)
- # reitit (11)
- # shadow-cljs (69)
- # squint (23)
- # tools-deps (30)
- # xtdb (3)
It might be a bit tricky in JS given that any kind of object can be thrown.
I’m guessing that you’re looking to convert an Error
object into a map?
It doesn’t attempt to parse the stack trace into a seq, but here is a simple attempt https://gist.github.com/quoll/acb206d2387d5c4f0ae690781eace6d6
It should provide something regardless of the type you give it, but it will provide the most data if you give it something that extends Error
cljs.user=> (Throwable->map {})
{:type cljs.core/PersistentArrayMap, :message "{}"}
cljs.user=> (Throwable->map "Error")
{:type String, :message "Error"}
cljs.user=> (Throwable->map (js/Error "There was an error"))
{:type Error,
:message "There was an error",
:stack "Error: There was an error\n at repl:1:127\n at repl:9:3\n at repl:14:4\n at Script.runInThisContext (node:vm:129:12)\n at Object.runInThisContext (node:vm:313:38)\n at Domain.<anonymous> ([stdin]:76:38)\n at Domain.run (node:domain:389:15)\n at Socket.<anonymous> ([stdin]:73:29)\n at Socket.emit (node:events:513:28)\n at Socket.emit (node:domain:489:12)"}
In case this is useful, I put it on github: https://github.com/quoll/cljs-error
hi everybody! I'm trying to figure out if it is possible to implement tooling that can interact with js runtimes (browser, node) thru a clojurescript repl. This is, instead of making tooling that connects via websocket to the js runtime, make everything thru clojurescript repls. Sending a command is just writing a form on the repl, but is there a way of implementing runtime sent events without constantly polling? Something like long polling, where I write on the repl (wait-for-events) and it will block there until something happens en the js runtime and then return?
hello. I’ve been exploring the Google Closure Library a bit & I was wondering if there were any goog.closure classes/methods/vars that people in the community especially appreciate and/or would recommend looking into?
There are many “hidden” gems. 🙂 With a quick grep I’ve used functions from these modules: • goog.object • goog.string.format • goog.string.path • goog.date.duration • goog.color • goog.color.alpha • goog.functions • goog.array • goog.crypt.base64 • goog.labs.userAgent.browser