This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-08-08
Channels
- # announcements (4)
- # babashka (6)
- # beginners (7)
- # calva (9)
- # cider (3)
- # clj-kondo (9)
- # clojure (8)
- # clojure-brasil (1)
- # clojure-europe (26)
- # clojure-norway (12)
- # clojure-uk (4)
- # datomic (15)
- # deps-new (9)
- # events (1)
- # jobs-discuss (6)
- # lsp (7)
- # malli (6)
- # missionary (26)
- # off-topic (4)
- # polylith (12)
- # reitit (25)
- # remote-jobs (1)
- # ring (6)
- # sql (3)
- # vim (1)
Hello everyone. Please recommend libraries for automating API testing of a ready-made application
#CQT1NFF4L
Can't recommend anything myself but I'd try searching in #C06MAR553 and with https://phronmophobic.github.io/dewey/search.html.
Is there a way to tell Timbre to print of an exception and also all its causes, not just the inner-most cause? If I do this:
(try
@(p/future (throw (Exception.)))
(catch Exception e
(.printStackTrace e)))
I get printed the stack trace of both Exception and ExecutionException:
java.util.concurrent.ExecutionException: java.lang.Exception
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2063)
at clojure.core$deref_future.invokeStatic(core.clj:2317)
at clojure.core$deref.invokeStatic(core.clj:2337)
at clojure.core$deref.invoke(core.clj:2323)
at nrepl.middleware.session$session_exec$main_loop__1077.invoke(session.clj:201)
....
at clojure.lang.AFn.run(AFn.java:22)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.Exception
...
at promesa.exec$wrap_bindings$fn__15950.invoke(exec.cljc:200)
at promesa.util.Supplier.get(util.cljc:34)
But when I use Tibre I just get the last one:
(try
@(p/future (throw (Exception.)))
(catch Exception e
(log/error e)))
2024-08-08T14:10:21.722Z Roks-MacBook-Pro-2.local ERROR [.portal.core:4] -
java.util.concurrent.ForkJoinWorkerThread.run ForkJoinWorkerThread.java: 183
java.util.concurrent.ForkJoinPool.runWorker ForkJoinPool.java: 1598
java.util.concurrent.ForkJoinPool.scan ForkJoinPool.java: 1665
java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec ForkJoinPool.java: 1016
java.util.concurrent.ForkJoinTask.doExec ForkJoinTask.java: 290
java.util.concurrent.CompletableFuture$AsyncSupply.exec CompletableFuture.java: 1756
java.util.concurrent.CompletableFuture$AsyncSupply.run CompletableFuture.java: 1764
promesa.util.Supplier/get util.cljc: 34
promesa.exec/wrap-bindings/fn exec.cljc: 200
.portal.core/eval49046/fn REPL Input:
java.lang.Exception:
java.util.concurrent.ExecutionException: java.lang.Exception
So I have no context where the future was “used” so the stack trace is pretty much useless at locating where the error occurred.Honestly, I feel a bit awkward doing the same thing to the same person two times in a row. :D But as you can guess, the common advice people often get here when the word "Timbre" is mentioned in a context of some problem is to stop using Timbre. Of course, you can just search for the word "Timbre" in this channel to see the reasons why, but the gist that I remember: • It hides not only causes but also some lines from the stacktrace. More often than not, it ends up being more confusing than helpful, especially when a person knows where the removed lines would come from • It changes the output format, which potentially makes your IDE confused (e.g. Cursive will offer helpful links to each location if the stacktrace is standard but IIRC the Timbre stacktrace doesn't have links - I have to go to locations that interest me by hand) • It doesn't look familiar to most people here, so it would be a bit harder to get help
A relevant issue with a solution, which doesn't seem to be trivial: https://github.com/taoensso/timbre/issues/317
thanks, this is just what I needed