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

Display stack traces on error #11

Closed
technomancy opened this issue Jul 14, 2012 · 6 comments
Closed

Display stack traces on error #11

technomancy opened this issue Jul 14, 2012 · 6 comments

Comments

@technomancy
Copy link
Contributor

We should check for the presence of clj-stacktrace first and prefer that to the built-in stuff.

@hugoduncan
Copy link
Member

In ritz, the clojure.lang.ExceptionData exceptions also display the map object contained in the exception. This would be nice to have in nrepl too. Not sure if that is a core, clj-stacktrace, or nrepl concern.

@Raynes
Copy link

Raynes commented Jul 20, 2012

Fake $10 reward to the person who does this issue.

@technomancy
Copy link
Contributor Author

I have a "stacktraces" branch that implements the beginnings of this, but I realized that it's not a very good approach. I didn't realize the err handler was for output on stderr; i thought it was just triggered when an error occurred.

I think we'll need to change this so we can wrap all outgoing evals in a try/catch that uses clj-stacktrace.repl/pst+ or falls back to clojure.stacktrace/print-stack-trace if it isn't found, and then the default err-handler should just put the output in an *nREPL error* buffer. If there's a way to override clojure.main/repl's :caught function, that would be even better.

Another hiccup is that ANSI color codes currently cause the bencode implementation to choke, so we'll need to stick with monochrome stacktraces until that's addressed.

@kingtim
Copy link
Member

kingtim commented Jul 23, 2012

nREPL will send a response with a status of "eval-error" when an exception occurs. I created a stacktrace branch which captures this event and displays a stacktrace. What do you think?

@Raynes
Copy link

Raynes commented Jul 23, 2012

It works for me. Awesome! I can totally use this now.

@kingtim
Copy link
Member

kingtim commented Jul 24, 2012

stacktrace branch merged, which implements basic printing of stacktraces. We can handle the issues ANSI color codes and the display of the map object suggested by @hugoduncan as separate items.

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

4 participants