Closed carocad closed 8 years ago
The truncated results in clojurescript, doesn't seem to truncate well so I get a very very wide inline error.
Might be some corner cases. Try evaling something like this i a cljs editor:
(// 1 1)
@rundis I changed the files that you commented.
Regarding the very wide inline error. It not exactly a corner case, but a remainder of the previous inline-exception behavior. The original cljs behavior used the stacktrace as summary and inline-text simultaneously. The precise lines are here: https://github.com/carocad/Clojure/blob/error_proposal/src/lt/plugins/clojure/collapsible_exception.cljs#L81-L90
msg (or (:stack res) (:ex res))
From what I could check, sometimes the stacktrace is not "summarized" but taken entirely. In those cases there is no difference between the msg
and stack
but since there is no line break for the span tag, it all just ends up in a very wide line.
I think we could truncate the summary; taking only (:ex res)
would leave the summary empty in some cases.
Tx for doing this and sorry for not being quicker to respond. Too many things going on. But we will get there. I think that apart for my minor comment on truncation, we are pretty much good to go :-)
@rundis any thoughts about the current proposal?
Looks good.
Could I just ask you for 2 more things and I'll merge;
@rundis done
@carocad Almost. When I said remove the .js and .js.map file I meant don't include them in the commit. If I merge now the existing files will be deleted on master.
@rundis you meant that?
tx for your contribution @carocad !
@carocad @rundis Nice!
@rundis could you please check if the truncation works on your clojurescript?
The case that we talked about (\\ 1 2)
is not being truncated on my Clojurescript. But I'm not sure if it is only because of my user modifications. I think though that I truncated the wrong variable (see here)
I think it should be
msg (or (truncate (:stack res)) (:ex res))
Hey guys, Here is the implementation of collapsible exceptions for Clojure(script) according to #77. I'm not completely sure about the correct implementation of the Clojurescript exception behavior as I have not properly tested it, but in principle it should work the same as with Clojure.