This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-28
Channels
- # admin-announcements (4)
- # beginners (11)
- # boot (148)
- # cider (74)
- # cljs-dev (31)
- # cljsrn (30)
- # clojure (55)
- # clojure-berlin (15)
- # clojure-greece (1)
- # clojure-japan (18)
- # clojure-poland (35)
- # clojure-russia (72)
- # clojure-spec (35)
- # clojure-uk (34)
- # clojurescript (134)
- # cursive (26)
- # datomic (42)
- # dirac (7)
- # editors-rus (1)
- # emacs (17)
- # hoplon (29)
- # jobs-rus (3)
- # juxt (1)
- # luminus (11)
- # off-topic (9)
- # om (66)
- # onyx (49)
- # pedestal (1)
- # perun (19)
- # proton (13)
- # protorepl (5)
- # re-frame (31)
- # reagent (13)
- # ring (2)
- # spacemacs (1)
- # specter (40)
- # spirituality-ethics (2)
- # test-check (41)
- # untangled (7)
- # yada (17)
Hey guys! Castra question: How can I prevent a stacktrace (in the event of an error) from being sent clientside, and instead write it to log? Perhaps an rpc/error
config alongside :rpc/pre
and rpc/query
?
@levitanong: wouldn’t try/catch on your server side functions handle that?
@raywillig: So you mean like, not throwing an exception at all, and just placing the logging code in the catch
clause?
@levitanong: yeah you could catch the exception log it and then throw a more palatable exception to your front end app
wrapping exceptions in castra exceptions is how you would return a better error message
@micha Yeah this is for a client. (That’s right folks, hoplon-castra is in data-heavy enterprise software!)
That’s exactly what my colleague, @syk0saje seems to be planning on doing.
Something about dfl-ex
still good to have, but it won't fix the stack trace issue, because any exception will have a trace associated with it
or maybe a :quiet
option, to remove extra metadata from the responses, like stack traces, etc
That would be great 😄
also not sure if i'm using the clj<->json converters right. i'm not passing in a first argument since i'm not sure if anything has to be there
added a try catch, but yeah this is just a workaround until something like :quiet is available for wrap-castra
@kenneth: taking a look at your issue now - tricky one!
@kenneth: i came up with this workaround:
(defn if-toggle
[predc then else]
(div (then :toggle predc)
(else :toggle (cell= (not predc)))))