Fork me on GitHub
Ferdinand Beyer09:09:57

I'd like to catch parse errors and extract the location (row, column). Unfortunately, the ex-data thrown in reader.cljc only puts this information into the message. I have a PR ready to add row and col to ex-data, if you agree this is useful?

Ferdinand Beyer09:09:05

While looking into :row and :col (see above), I think I found a bug: When parsing this with ClojureScript:

(p/parse-string "(defn foo [)")
...I do not get ExceptionInfo with a useful Unmatched delimiter message like in Clojure, but: TypeError: Right-hand side of 'instanceof' is not an object

❌ 1
Ferdinand Beyer13:09:48

Yeah no, that was on me. Don't (catch Exception _) in .cljc files 😉


@fb Yes, I think that would be good to have.


edamame already does this

👍 1
Ferdinand Beyer10:09:14

PR here: I think the tests will not pass because of aforementioned issue with TypeError in ClojureScript. I'm not sure if I can look into this right now and I think it is unrelated to my changes.


@fb seems like a good idea to me too! Thanks for thinking of it and taking a stab at it. I’ll take a peek at your PR sometime soon.

👍 1

Thanks for the PR, update, and your contribution @fb!

Ferdinand Beyer14:09:27

My pleasure! It was such a tiny contribution though 😄


But valuable, yeah? And you thought of it and did it!

Ferdinand Beyer14:09:11

Yes, I'm selfish. I no longer want to parse the exception message! 😛


Selfish and generous, and good combo!

😆 1