public class ScriptException extends ElasticsearchException
A ScriptException has the following components:
message
: A short and simple summary of what happened, such as "compile error".
cause
: The underlying cause of the exception.
scriptStack
: An implementation-specific "stacktrace" for the error in the script.
script
: Identifier for which script failed.
lang
: Scripting engine language, such as "painless"
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
REST_EXCEPTION_SKIP_STACK_TRACE, REST_EXCEPTION_SKIP_STACK_TRACE_DEFAULT
EMPTY_PARAMS
Constructor and Description |
---|
ScriptException(StreamInput in)
Deserializes a ScriptException from a
StreamInput |
ScriptException(java.lang.String message,
java.lang.Throwable cause,
java.util.List<java.lang.String> scriptStack,
java.lang.String script,
java.lang.String lang)
Create a new ScriptException.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getLang()
Returns the language of the script.
|
java.lang.String |
getScript()
Returns the identifier for which script.
|
java.util.List<java.lang.String> |
getScriptStack()
Returns the stacktrace for the error in the script.
|
protected void |
metadataToXContent(XContentBuilder builder,
ToXContent.Params params)
Renders additional per exception information into the XContent
|
java.lang.String |
toJsonString()
Returns a JSON version of this exception for debugging.
|
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
addHeader, addHeader, addMetadata, addMetadata, failureFromXContent, fromXContent, generateFailureXContent, generateThrowableXContent, getDetailedMessage, getExceptionName, getExceptionName, getHeader, getHeaderKeys, getHeaders, getId, getIndex, getMetadata, getMetadata, getMetadataKeys, getResourceId, getResourceType, getRootCause, getShardId, guessRootCauses, guessRootCauses, innerToXContent, isRegistered, readException, readStackTrace, setIndex, setIndex, setResources, setShard, status, toString, toXContent, unwrapCause, writeStackTraces
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isFragment
public ScriptException(java.lang.String message, java.lang.Throwable cause, java.util.List<java.lang.String> scriptStack, java.lang.String script, java.lang.String lang)
message
- A short and simple summary of what happened, such as "compile error".
Must not be null
.cause
- The underlying cause of the exception. Must not be null
.scriptStack
- An implementation-specific "stacktrace" for the error in the script.
Must not be null
, but can be empty (though this should be avoided if possible).script
- Identifier for which script failed. Must not be null
.lang
- Scripting engine language, such as "painless". Must not be null
.java.lang.NullPointerException
- if any parameters are null
.public ScriptException(StreamInput in) throws java.io.IOException
StreamInput
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
writeTo
in interface Writeable
writeTo
in class ElasticsearchException
java.io.IOException
protected void metadataToXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
ElasticsearchException
metadataToXContent
in class ElasticsearchException
java.io.IOException
public java.util.List<java.lang.String> getScriptStack()
public java.lang.String getScript()
public java.lang.String getLang()
lang
parameter of the scripting engine.public java.lang.String toJsonString()