This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-21
Channels
- # calva (11)
- # cider (4)
- # clojure (15)
- # clojure-europe (20)
- # clojurescript (14)
- # clr (45)
- # conjure (2)
- # cursive (1)
- # fulcro (10)
- # helix (4)
- # honeysql (7)
- # hoplon (21)
- # humbleui (2)
- # hyperfiddle (23)
- # introduce-yourself (1)
- # malli (11)
- # matrix (3)
- # off-topic (6)
- # pathom (2)
- # practicalli (1)
- # re-frame (9)
- # releases (1)
- # specter (2)
- # sql (10)
- # xtdb (2)
ISTR there was talk at some point of supporting Exception
in catch
to make it easier to write portable code -- did that go anywhere? Cljs doesn't have the dual exception hierarchy like Clojure/JVM, right? (catching Throwable
should probably be considered a code smell...?)
there's at least one old ticket on this, maybe one in CLJ and in CLJS
Ah, the latter ticket leads to the former... 🙂 OK, so we're not likely to see portable catch
any time soon, I'd imagine, given the age of that ticket.
https://ask.clojure.org/index.php/1953/support-try-catch-default-for-portable-catch-all
does not seem to be a burning desire even after all this time
I added a vote, for what it's worth 🙂
The big issue I see with the proposal is that the “portability” claims fall down the moment you need to care about the Exception or Error object in CLJ and CLJS, respectively; so I see limited value in this addition
Also I agree that catching Throwable
isn’t a good idea
ex-message
, ex-data
, ex-cause
help with surface portability -- it's a question of how deep into the object you need to go... what sort of things do you typically pick out of the object @U0479UCF48H?
Usually getting messages or stack traces out of the object. In the case of CLJS, I typically get the message
field out of an Error
object and pass it back to some code that then displays some sort of alert with the error message (or logs the string somewhere with a level of ERROR).
So ex-message
would mostly work for you?
If you have feedback, please add it to the ask question page, not here