nbb

liebs 2022-12-19T18:07:07.625899Z

Is there a way to get line numbers in error messages? All I'm seeing is this:

----- Error --------------------------------------
Type:     SyntaxError
Message:  Unexpected token u in JSON at position 0
Unexpected token u in JSON at position 0

borkdude 2022-12-19T18:43:34.148779Z

It depends, need a fuller repro

liebs 2022-12-19T18:48:25.825349Z

I'm working in this p/let block

(p/let [content (fs/readFile credentials-path (fn [r] r))
          keys (try (js/JSON.parse content) (catch js/Error _ (js/console.log "this is where it breaks"))))
and have narrowed down the error to the JSON.parse. So not necessary to get line no's in this particular case. I think metadata for functions supports line #s though, right? in JVM Clojure at least.

borkdude 2022-12-19T18:50:07.300669Z

Normally you get a line number but in async code this often gets lost in nbb. Could make an issue to see if something can be done about it

liebs 2022-12-19T19:00:29.367729Z

Yeah, I'll tinker with this. CLJS is not a strong suit of mine so I'd like to figure this out for this little script and then I can put the issue in if you like.

👍 1