shdqcdsn / counterclockwise

Automatically exported from code.google.com/p/counterclockwise
0 stars 0 forks source link

Missing Error Handling for reading REPL comma #576

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Invalid Clojure data in .settings/ccw.repl.cmdhistory.prefs, e.g. 
>>cmdhistory=["a" "b"<<
2. Starting the REPL in the affected project.

What is the expected output? What do you see instead?
Expected: REPL should start up just fine.
Instead: Exception message "Invalid REPL" is printed in the REPL view and 
nothing can be evaluated. (assumption: REPL did not start.)

Suggestion: Error handling when loading the REPL command history. The easiest 
fix is just to have no command history if loading fails. A more advanced fix 
might recover the valid entries.

Exception in log:
!ENTRY ccw.core 4 0 2013-05-24 12:13:17.516
!MESSAGE Could not connect REPL to local launch
!STACK 0
java.lang.RuntimeException: EOF while reading string
   at clojure.lang.Util.runtimeException(Util.java:219)
   at clojure.lang.LispReader$StringReader.invoke(LispReader.java:461)
   at clojure.lang.LispReader.readDelimitedList(LispReader.java:1148)
   at clojure.lang.LispReader$VectorReader.invoke(LispReader.java:1083)
   at clojure.lang.LispReader.read(LispReader.java:185)
   at clojure.lang.RT.readString(RT.java:1738)
   at clojure.core$read_string.invoke(core.clj:3427)
   at ccw.repl.cmdhistory$get_history.invoke(cmdhistory.clj:59)
   at ccw.repl.view_helpers$configure_repl_view.invoke(view_helpers.clj:114)
   at clojure.lang.Var.invoke(Var.java:427)
   at ccw.util.ClojureUtils.invoke(ClojureUtils.java:64)
   at ccw.util.ClojureInvoker._(ClojureInvoker.java:29)
   at ccw.repl.REPLView.prepareView(REPLView.java:324)
   at ccw.repl.REPLView.configure(REPLView.java:334)
   at ccw.repl.REPLView.connect(REPLView.java:361)
   at ccw.launching.ClojureLaunchDelegate$REPLViewLaunchMonitor$1$1.connectRepl(ClojureLaunchDelegate.java:154)
   at ccw.launching.ClojureLaunchDelegate$REPLViewLaunchMonitor$1$1.run(ClojureLaunchDelegate.java:142)
   at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:164)
   at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:158)
   at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
   at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
   at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3537)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3189)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
   at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
   at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
   at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
   at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
   at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:601)
   at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
   at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

Original issue reported on code.google.com by Gunnar.V...@googlemail.com on 24 May 2013 at 10:20

GoogleCodeExporter commented 9 years ago
CCW version 0.12.3

Original comment by Gunnar.V...@googlemail.com on 24 May 2013 at 10:22

GoogleCodeExporter commented 9 years ago
I've sent a pull request that fixes the issue: 
https://github.com/laurentpetit/ccw/pull/24

Original comment by noid....@gmail.com on 30 Jun 2013 at 1:23

GoogleCodeExporter commented 9 years ago
It's a nice fix.

I've added a comment asking for a little reorganization of the test code: 
https://github.com/noidi/ccw/commit/38e0ca4f54667997aa74a62a261c00f8f899d3ea#com
mitcomment-3551311

Original comment by laurent....@gmail.com on 2 Jul 2013 at 8:04

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 3 Oct 2013 at 4:56

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 22 May 2014 at 8:18