File tree Expand file tree Collapse file tree 4 files changed +10
-15
lines changed
src/main/java/org/scijava Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 3434import java .lang .reflect .InvocationTargetException ;
3535import java .lang .reflect .Method ;
3636
37- import javax .script .ScriptException ;
38-
3937import org .scijava .Priority ;
4038import org .scijava .log .LogService ;
4139import org .scijava .plugin .Parameter ;
@@ -57,18 +55,15 @@ public class MainRunner extends AbstractClassRunner {
5755 // -- ClassRunner methods --
5856
5957 @ Override
60- public void run (final Class <?> c ) throws ScriptException {
58+ public void run (final Class <?> c ) throws InvocationTargetException {
6159 try {
6260 getMain (c ).invoke (null , new Object [] { new String [0 ] });
6361 }
6462 catch (final IllegalArgumentException exc ) {
65- throw new ScriptException (exc );
63+ throw new InvocationTargetException (exc );
6664 }
6765 catch (final IllegalAccessException exc ) {
68- throw new ScriptException (exc );
69- }
70- catch (final InvocationTargetException exc ) {
71- throw new ScriptException (exc );
66+ throw new InvocationTargetException (exc );
7267 }
7368 }
7469
Original file line number Diff line number Diff line change 3131
3232package org .scijava .run ;
3333
34- import javax . script . ScriptException ;
34+ import java . lang . reflect . InvocationTargetException ;
3535
3636import org .scijava .plugin .HandlerPlugin ;
3737import org .scijava .plugin .Plugin ;
5353public interface ClassRunner extends HandlerPlugin <Class <?>> {
5454
5555 /** Executes the given class. */
56- void run (Class <?> c ) throws ScriptException ;
56+ void run (Class <?> c ) throws InvocationTargetException ;
5757
5858}
Original file line number Diff line number Diff line change 3131
3232package org .scijava .run ;
3333
34- import javax . script . ScriptException ;
34+ import java . lang . reflect . InvocationTargetException ;
3535
3636import org .scijava .log .LogService ;
3737import org .scijava .plugin .AbstractHandlerService ;
@@ -55,14 +55,14 @@ public class DefaultRunService extends
5555 // -- RunService methods --
5656
5757 @ Override
58- public void run (final Class <?> c ) throws ScriptException {
58+ public void run (final Class <?> c ) throws InvocationTargetException {
5959 for (final ClassRunner runner : getInstances ()) {
6060 if (runner .supports (c )) {
6161 runner .run (c );
6262 return ;
6363 }
6464 }
65- log . error ("Unknown class type: " + c .getName ());
65+ throw new IllegalArgumentException ("Unknown class type: " + c .getName ());
6666 }
6767
6868 // -- PTService methods --
Original file line number Diff line number Diff line change 3131
3232package org .scijava .run ;
3333
34- import javax . script . ScriptException ;
34+ import java . lang . reflect . InvocationTargetException ;
3535
3636import org .scijava .plugin .HandlerService ;
3737import org .scijava .service .SciJavaService ;
@@ -46,6 +46,6 @@ public interface RunService extends
4646{
4747
4848 /** Executes the given class using the most appropriate handler. */
49- void run (Class <?> c ) throws ScriptException ;
49+ void run (Class <?> c ) throws InvocationTargetException ;
5050
5151}
You can’t perform that action at this time.
0 commit comments