Commits

sk  committed c5dd7b1

Moved lisp executable check from lisp implementation to lisp launcher.

  • Participants
  • Parent commits 026919c

Comments (0)

Files changed (1)

File src/org/lispdev/swank/BaseLocalLispLaunchDelegate.java

   protected static SwankInterface launch(ILaunchConfiguration config,
       ILaunch launch) throws CoreException
   {
+    final String exe = config.getAttribute(ATTR_EXE, "");
+    File cmd = new File(exe);
+    if( !cmd.exists() )
+    {
+      Log.abort("Lisp executable "+exe+" does not exist", null);
+    }
+    if( !cmd.canExecute() )
+    {
+      Log.abort("File " + exe + " is not executable", null);
+    }
     final LocalLispImplementation implem =
-      new LocalLispImplementation(config.getAttribute(ATTR_EXE, ""),
+      new LocalLispImplementation(exe,
           config.getAttribute(ATTR_CMD_PARAMS, new ArrayList()),
           config.getAttribute(ATTR_ENV, new HashMap()),
           config.getAttribute(ATTR_PORT, 4005));
-    // FIXME: right now paths are checked in lisp implementation and
-    // produce runtime exceptions if something wrong
-    // instead should check here and produce coreexceptions
     final String ext = config.getAttribute(ATTR_EXT, "");
     final File extf = new File(ext);
     if( !extf.isDirectory() )
     {
-      Log.abort("Directory "+ext+" does not exist", null);
+      Log.abort("Extensions directory "+ext+" does not exist", null);
     }
     final SwankInterface s = new SwankInterface(ext,4005,implem);