Hello Clay developers, in the case of an error generating a notebook with clay/make, would it be possible to report the line of the notebook where error is occurring? The stacktrace does not show any information about the offending line of the notebook.
Execution error (AssertionError) at org.soulspace.qclojure.domain.circuit/circuit-depth (circuit.clj:1378).
Assert failed: (s/valid? :org.soulspace.qclojure.domain.circuit/quantum-circuit circuit)
scicloj.clay.v2.make/clay-render-notebook (make.clj:392)
scicloj.clay.v2.make/clay-render-notebook (make.clj:355)
scicloj.clay.v2.make/handle-single-source-spec! (make.clj:435)
scicloj.clay.v2.make/handle-single-source-spec! (make.clj:408)
clojure.core/mapv (core.clj:7059)
clojure.lang.ArrayChunk/reduce (ArrayChunk.java:60)
clojure.core.protocols/fn (protocols.clj:135)
clojure.core.protocols/fn (protocols.clj:123)
clojure.core.protocols/fn (protocols.clj:19)
clojure.core.protocols/seq-reduce (protocols.clj:31)
clojure.core.protocols/fn (protocols.clj:74)
clojure.core.protocols/fn (protocols.clj:13)
clojure.core/reduce (core.clj:6965)
clojure.core/mapv (core.clj:7050)
scicloj.clay.v2.make/make! (make.clj:483)
scicloj.clay.v2.make/make! (make.clj:471)
scicloj.clay.v2.api/make! (api.clj:35)
scicloj.clay.v2.api/make! (api.clj:34)
dev/eval45447 (NO_SOURCE_FILE:7)
clojure.lang.Compiler/eval (Compiler.java:7739)
nrepl.middleware.interruptible-eval/evaluator (interruptible_eval.clj:106)
nrepl.middleware.interruptible-eval/evaluator (interruptible_eval.clj:101)
nrepl.middleware.session/session-exec (session.clj:230)
nrepl.SessionThread/run (SessionThread.java:21)
The notebook has 1500+ lines, so single stepping through every line of code is a bit cumbersome.Hi Ludger, thanks for looking into this. It is helpful to know about anything that could be made more convenient.
I see circuit.clj:1378 at the beginning. Is it not the line?
Oh, the generated html output shows the location of the error. That's good. But some context with the exception would be helpful nevertheless.
The circuit.clj:1378 is the line, where the assertion failed, but not the line of the notebook that triggered the code. As the code is executed by clay and not by the notebook, the context of the notebook is not in the stacktrace.
I see, thanks.
Recently there have been some changes in exception reporting in the Clay browser view, by the way. So different versions behave differently. For reference, changes have been discussed recently here (requires Zulip login): https://clojurians.zulipchat.com/#narrow/channel/422115-clay-dev/topic/PR.20254.20-.20exception.20handling/ Anyway, I'll look into the behaviour you described. Probably not today.
I'm using 2-beta52 and the report in the browser is fine. But I wasn't looking at the browser because I thought the generation had failed and the browser was on a different workspace.
thanks