This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-27
Channels
- # adventofcode (7)
- # announcements (31)
- # babashka (15)
- # beginners (14)
- # calva (45)
- # circleci (6)
- # clojure (27)
- # clojure-europe (19)
- # clojure-france (2)
- # clojure-gamedev (4)
- # clojure-uk (2)
- # clojurescript (26)
- # conjure (14)
- # data-science (6)
- # deps-new (7)
- # depstar (4)
- # emacs (13)
- # events (1)
- # fulcro (20)
- # graalvm (2)
- # hoplon (30)
- # joker (11)
- # london-clojurians (1)
- # malli (26)
- # pathom (2)
- # re-frame (13)
- # reagent (8)
- # reclojure (3)
- # reveal (8)
- # robots (4)
- # shadow-cljs (29)
- # sql (5)
- # tools-deps (28)
- # vim (4)
Hey guys! I recently learned about Hoplon through a Clojurescript podcast interview with @alandipert. I've been digging through the docs and I'm a little confused about Castra integration. I have a few questions that hopefully someone here can answer.
Is Castra/rpc the recommended way in 2020 to communicate with a backend server or should I look into other options?
Using this snippet (https://github.com/hoplon/hoplon/wiki/Castra) to show business logic errors like "password mismatch" I always get "Server error.". What am I doing wrong?
The way I understand it is that my rpc function should be given 3 cells: result
, error
and loading
. Should error
contain business logic errors and, therefore, my backend rpc function should raise exceptions, or should error
be restricted only to server errors?
hi, welcome! i think castra is still "valid" in 2020 if you don't mind have a clj-specific backend
backend errors become exceptions on the client, in the error cell iirc
Hi @alandipert! Congrats for the great episode, btw! 🎉 I enjoyed learning about a different way of coding front ends.
cc @micha ⬆️
thanks, i'm glad you liked it, it was my pleasure. i think i've tried all the ways 😂
Ok, so my assumptions were correct. So why do I get "Server error." and not the exception message that I originally threw?
I was about to fork and debug this issue, but I hardly think this would be an open issue for 5+ years.
So ig I'm probably doing something wrong, but I can't figure out what. This is the message that I always get: https://github.com/hoplon/castra/blob/master/src/castra/core.cljs#L94
and you don't see anything for :cause ?
It's funny because when I inspect the actual transit response, the entire stack trace is there.
i see some aset
business in make-ex
, i suspect its setting properties on the ex obj that aren't being pretty printed
..maybe. to your point about a bug for 5+ yrs, i think it's likeliest the example is stale, since i know ppl are using the code
are you using the examples from the castra readme?
also possible re: cljs, maybe less likely
But this always returns "Server error." regardless of the original messaged that was raised in the backend rpc function.
i have to go, but it sounds like you perhaps got to the bottom of it?
Thanks for the help @alandipert
great, and np! curious to hear about your build tooling when you get a chance