ScriptException -> GeneralScriptException (https://github.com/elastic/elasticsearch/pull/18600)
Original commit: elastic/x-pack-elasticsearch@0536fe9222
This commit is contained in:
parent
fb4befac4e
commit
21b2494c5b
|
@ -13,7 +13,7 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
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.search.internal.InternalSearchResponse;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
|
@ -138,7 +138,7 @@ public class ScriptConditionTests extends ESTestCase {
|
|||
try {
|
||||
conditionParser.createExecutable(scriptCondition);
|
||||
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
|
||||
// assertThat(e.getMessage(), is("ASDF"));
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ public class ScriptConditionTests extends ESTestCase {
|
|||
try {
|
||||
conditionParser.createExecutable(scriptCondition);
|
||||
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
|
||||
// assertThat(e.getMessage(), is("ASDF"));
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
package org.elasticsearch.xpack.watcher.support;
|
||||
|
||||
import org.elasticsearch.common.settings.SettingsException;
|
||||
import org.elasticsearch.script.ScriptException;
|
||||
import org.elasticsearch.script.GeneralScriptException;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -45,9 +45,9 @@ public class Exceptions {
|
|||
}
|
||||
|
||||
|
||||
//todo remove once ScriptException supports varargs
|
||||
public static ScriptException invalidScript(String msg, Object... args) {
|
||||
throw new ScriptException(format(msg, args));
|
||||
//todo remove once GeneralScriptException supports varargs
|
||||
public static GeneralScriptException invalidScript(String msg, Object... args) {
|
||||
throw new GeneralScriptException(format(msg, args));
|
||||
}
|
||||
|
||||
//todo remove once SettingsException supports varargs
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
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.search.internal.InternalSearchResponse;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
|
@ -138,7 +138,7 @@ public class ScriptConditionTests extends ESTestCase {
|
|||
try {
|
||||
conditionParser.createExecutable(scriptCondition);
|
||||
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
|
||||
// assertThat(e.getMessage(), is("ASDF"));
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ public class ScriptConditionTests extends ESTestCase {
|
|||
try {
|
||||
conditionParser.createExecutable(scriptCondition);
|
||||
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
|
||||
// assertThat(e.getMessage(), is("ASDF"));
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.elasticsearch.common.xcontent.XContentParser;
|
|||
import org.elasticsearch.common.xcontent.json.JsonXContent;
|
||||
import org.elasticsearch.script.CompiledScript;
|
||||
import org.elasticsearch.script.ExecutableScript;
|
||||
import org.elasticsearch.script.ScriptException;
|
||||
import org.elasticsearch.script.GeneralScriptException;
|
||||
import org.elasticsearch.script.ScriptService.ScriptType;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
|
@ -195,7 +195,7 @@ public class ScriptTransformTests extends ESTestCase {
|
|||
try {
|
||||
transformFactory.createExecutable(scriptTransform);
|
||||
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!
|
||||
assertThat(e.getMessage(), containsString("script_lang not supported [groovy]"));
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ public class ScriptTransformTests extends ESTestCase {
|
|||
try {
|
||||
transformFactory.createExecutable(scriptCondition);
|
||||
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]"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue