ScriptException -> GeneralScriptException (https://github.com/elastic/elasticsearch/pull/18600)

Original commit: elastic/x-pack-elasticsearch@0536fe9222
This commit is contained in:
Robert Muir 2016-05-26 17:51:46 -04:00
parent fb4befac4e
commit 21b2494c5b
4 changed files with 13 additions and 13 deletions

View File

@ -13,7 +13,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.script.ScriptException; import org.elasticsearch.script.GeneralScriptException;
import org.elasticsearch.script.ScriptService.ScriptType; import org.elasticsearch.script.ScriptService.ScriptType;
import org.elasticsearch.search.internal.InternalSearchResponse; import org.elasticsearch.search.internal.InternalSearchResponse;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
@ -138,7 +138,7 @@ public class ScriptConditionTests extends ESTestCase {
try { try {
conditionParser.createExecutable(scriptCondition); conditionParser.createExecutable(scriptCondition);
fail("expected a condition validation exception trying to create an executable with a bad or missing script"); fail("expected a condition validation exception trying to create an executable with a bad or missing script");
} catch (ScriptException e) { } catch (GeneralScriptException e) {
// TODO add these when the test if fixed // TODO add these when the test if fixed
// assertThat(e.getMessage(), is("ASDF")); // assertThat(e.getMessage(), is("ASDF"));
} }
@ -155,7 +155,7 @@ public class ScriptConditionTests extends ESTestCase {
try { try {
conditionParser.createExecutable(scriptCondition); conditionParser.createExecutable(scriptCondition);
fail("expected a condition validation exception trying to create an executable with an invalid language"); fail("expected a condition validation exception trying to create an executable with an invalid language");
} catch (ScriptException e) { } catch (GeneralScriptException e) {
// TODO add these when the test if fixed // TODO add these when the test if fixed
// assertThat(e.getMessage(), is("ASDF")); // assertThat(e.getMessage(), is("ASDF"));
} }

View File

@ -6,7 +6,7 @@
package org.elasticsearch.xpack.watcher.support; package org.elasticsearch.xpack.watcher.support;
import org.elasticsearch.common.settings.SettingsException; import org.elasticsearch.common.settings.SettingsException;
import org.elasticsearch.script.ScriptException; import org.elasticsearch.script.GeneralScriptException;
import java.io.IOException; import java.io.IOException;
@ -45,9 +45,9 @@ public class Exceptions {
} }
//todo remove once ScriptException supports varargs //todo remove once GeneralScriptException supports varargs
public static ScriptException invalidScript(String msg, Object... args) { public static GeneralScriptException invalidScript(String msg, Object... args) {
throw new ScriptException(format(msg, args)); throw new GeneralScriptException(format(msg, args));
} }
//todo remove once SettingsException supports varargs //todo remove once SettingsException supports varargs

View File

@ -14,7 +14,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.script.ScriptException; import org.elasticsearch.script.GeneralScriptException;
import org.elasticsearch.script.ScriptService.ScriptType; import org.elasticsearch.script.ScriptService.ScriptType;
import org.elasticsearch.search.internal.InternalSearchResponse; import org.elasticsearch.search.internal.InternalSearchResponse;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
@ -138,7 +138,7 @@ public class ScriptConditionTests extends ESTestCase {
try { try {
conditionParser.createExecutable(scriptCondition); conditionParser.createExecutable(scriptCondition);
fail("expected a condition validation exception trying to create an executable with a bad or missing script"); fail("expected a condition validation exception trying to create an executable with a bad or missing script");
} catch (ScriptException e) { } catch (GeneralScriptException e) {
// TODO add these when the test if fixed // TODO add these when the test if fixed
// assertThat(e.getMessage(), is("ASDF")); // assertThat(e.getMessage(), is("ASDF"));
} }
@ -155,7 +155,7 @@ public class ScriptConditionTests extends ESTestCase {
try { try {
conditionParser.createExecutable(scriptCondition); conditionParser.createExecutable(scriptCondition);
fail("expected a condition validation exception trying to create an executable with an invalid language"); fail("expected a condition validation exception trying to create an executable with an invalid language");
} catch (ScriptException e) { } catch (GeneralScriptException e) {
// TODO add these when the test if fixed // TODO add these when the test if fixed
// assertThat(e.getMessage(), is("ASDF")); // assertThat(e.getMessage(), is("ASDF"));
} }

View File

@ -12,7 +12,7 @@ import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.script.CompiledScript; import org.elasticsearch.script.CompiledScript;
import org.elasticsearch.script.ExecutableScript; import org.elasticsearch.script.ExecutableScript;
import org.elasticsearch.script.ScriptException; import org.elasticsearch.script.GeneralScriptException;
import org.elasticsearch.script.ScriptService.ScriptType; import org.elasticsearch.script.ScriptService.ScriptType;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;
@ -195,7 +195,7 @@ public class ScriptTransformTests extends ESTestCase {
try { try {
transformFactory.createExecutable(scriptTransform); transformFactory.createExecutable(scriptTransform);
fail("expected a transform validation exception trying to create an executable with a bad or missing script"); fail("expected a transform validation exception trying to create an executable with a bad or missing script");
} catch (ScriptException e) { } catch (GeneralScriptException e) {
// I don't think this is what this test intended to check! // I don't think this is what this test intended to check!
assertThat(e.getMessage(), containsString("script_lang not supported [groovy]")); assertThat(e.getMessage(), containsString("script_lang not supported [groovy]"));
} }
@ -218,7 +218,7 @@ public class ScriptTransformTests extends ESTestCase {
try { try {
transformFactory.createExecutable(scriptCondition); transformFactory.createExecutable(scriptCondition);
fail("expected a transform validation exception trying to create an executable with an invalid language"); fail("expected a transform validation exception trying to create an executable with an invalid language");
} catch (ScriptException e) { } catch (GeneralScriptException e) {
assertThat(e.getMessage(), containsString("script_lang not supported [not_a_valid_lang]")); assertThat(e.getMessage(), containsString("script_lang not supported [not_a_valid_lang]"));
} }
} }