Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved error message rendering for nbb and nbb repl #365

Open
andersmurphy opened this issue Sep 19, 2024 · 0 comments
Open

Improved error message rendering for nbb and nbb repl #365

andersmurphy opened this issue Sep 19, 2024 · 0 comments

Comments

@andersmurphy
Copy link

andersmurphy commented Sep 19, 2024

Currently the error messages in nbb and nbb repl are returned as strings eg:

"#error {:message \"Could not resolve symbol: createUmi\", :data {:type :sci/error, :line 2, :column 7, :message \"Could not resolve symbol: createUmi\", :sci.impl/callstack #object[cljs.core.Volatile {:val ({:line 1, :column 1, :ns #object[Is user], :file nil} {:line 2, :column 3, :ns #object[Is user], :file nil} {:line 2, :column 3, :ns #object[Is user], :file nil, :sci.impl/f-meta {:ns #object[Is clojure.core], :macro true, :sci/built-in true, :name ->, :arglists ([x & forms]), :doc \"Threads the expr through the forms. Inserts x as the\\n second item in the first form, making a list of it if it is not a\\n list already. If there are more forms, inserts the first form as the\\n second item in second form, etc.\"}} {:line 3, :column 5, :ns #object[Is user], :file nil} {:line 2, :column 7, :ns #object[Is user], :file nil})}], :file nil, :phase \"analysis\"}, :cause #error {:message \"Could not resolve symbol: createUmi\", :data {:type :sci/error, :line 1, :column 1, :file nil, :phase \"analysis\"}}}"

This makes them hard to read. Returning these errors as a map rather than a string and pretty printing them would make them much easier to parse (this would also remove the nested string quotes etc).

Related to this, is there a simple way to add a pretty printer for output (this comes up in environments where nrepl/socket relp are not available)?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant