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

Better exceptions #13

Open
pesterhazy opened this issue Jul 29, 2017 · 0 comments
Open

Better exceptions #13

pesterhazy opened this issue Jul 29, 2017 · 0 comments

Comments

@pesterhazy
Copy link
Collaborator

The way unravel prints exceptions is hard to read

Using a plain clojure jar

user=> (/)
ExceptionInfo Exception during eval phase.  clojure.core$ex_info.invokeStatic (core.clj)
ArityException Wrong number of args (0) passed to: core//  clojure.lang.AFn.throwArity (AFn.java)
	clojure.lang.AFn.throwArity (AFn.java)
	clojure.lang.RestFn.invoke (RestFn.java)
	user$eval779.invokeStatic (unrepl-session)
	user$eval779.invoke (unrepl-session)
	clojure.lang.Compiler.eval (Compiler.java)
	clojure.lang.Compiler.eval (Compiler.java)
	clojure.core$eval.invokeStatic (core.clj)
	clojure.core$eval.invoke (core.clj)
	unrepl.replG__18$start$interruptible_eval__350$fn__351$fn__352$fn__353.invoke (NO_SOURCE_FILE)
	clojure.lang.AFn.applyToHelper (AFn.java)
	#__1

Using BOOT_VERSION=2.7.2-SNAPSHOT boot socket-server --port=50505 wait:

user=> (/)
#unrepl.java/class clojure.lang.ExceptionInfo Exception during eval phase.  (unknown)
#unrepl.java/class clojure.lang.ArityException Wrong number of args (0) passed to: core//  (unknown)
	#unrepl/object [#unrepl.java/class java.lang.StackTraceElement "0x5858e7a5" "clojure.lang.AFn.throwArity(AFn.java:429)" {:bean {#__22 #__23}}]
	#unrepl/object [#unrepl.java/class java.lang.StackTraceElement "0x64722719" "clojure.lang.RestFn.invoke(RestFn.java:399)" {:bean {#__24 #__25}}]
	#unrepl/object [#unrepl.java/class java.lang.StackTraceElement "0x658c7cd6" "user$eval919.invokeStatic(unrepl-session:5)" {:bean {#__26 #__27}}]
	#unrepl/object [#unrepl.java/class java.lang.StackTraceElement "0x17fed1ca" "user$eval919.invoke(unrepl-session:5)" {:bean {#__28 #__29}}]
	#unrepl/object [#unrepl.java/class java.lang.StackTraceElement "0x5ded34f6" "clojure.lang.Compiler.eval(Compiler.java:6927)" {:bean {#__30 #__31}}]
	#unrepl/object [#unrepl.java/class java.lang.StackTraceElement "0x3c6af889" "clojure.lang.Compiler.eval(Compiler.java:6890)" {:bean {#__32 #__33}}]
	#unrepl/object [#unrepl.java/class java.lang.StackTraceElement "0x476f4758" "clojure.core$eval.invokeStatic(core.clj:3105)" {:bean {#__34 #__35}}]
	#unrepl/object [#unrepl.java/class java.lang.StackTraceElement "0x448aaf55" "clojure.core$eval.invoke(core.clj:3101)" {:bean {#__36 #__37}}]
	#unrepl/object [#unrepl.java/class java.lang.StackTraceElement "0x64921c39" "unrepl.replG__51$start$interruptible_eval__375$fn__376$fn__377$fn__378.invoke(NO_SOURCE_FILE:495)" {:bean {#__38 #__39}}]
	#unrepl/object [#unrepl.java/class java.lang.StackTraceElement "0x4fd566bc" "clojure.lang.AFn.applyToHelper(AFn.java:152)" {:bean {#__40 #__41}}]
	#__42

Not sure why a server started by boot produces different exceptions.

In either case, exceptions should be printed in a more readable style, with long stack traces collapsed by default and a way to expand interactively.

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