Fixed error message for SubedCommand run exceptions

This commit is contained in:
Emmanuel Bigeon 2016-06-12 23:02:03 -04:00
parent 59ab689a36
commit eed6f43aea
2 changed files with 4 additions and 2 deletions

View File

@ -113,8 +113,7 @@ public class ScriptExecution extends Command {
e.getLocalizedMessage() + ")", //$NON-NLS-1$ e.getLocalizedMessage() + ")", //$NON-NLS-1$
e, this); e, this);
} catch (IOException e) { } catch (IOException e) {
throw new CommandRunException( throw new CommandRunException("Unable to read script", //$NON-NLS-1$
"Unable to read script (" + e.getLocalizedMessage() + ")", //$NON-NLS-1$ //$NON-NLS-2$
e, this); e, this);
} }
} }

View File

@ -122,6 +122,9 @@ public class SubedCommand implements ICommandProvider, ICommand {
try { try {
executeSub(args[0], Arrays.copyOfRange(args, 1, args.length)); executeSub(args[0], Arrays.copyOfRange(args, 1, args.length));
} catch (CommandRunException e) { } catch (CommandRunException e) {
if (e.getSource() != null) {
throw e;
}
throw new CommandRunException(CommandRunExceptionType.USAGE, throw new CommandRunException(CommandRunExceptionType.USAGE,
e.getLocalizedMessage(), e, this); e.getLocalizedMessage(), e, this);
} }