# Class EvalError

java.lang.Object
java.lang.Throwable
java.lang.Exception
bsh.EvalError

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `ParseException, TargetError`

public class EvalError extends Exception
EvalError indicates that we cannot continue evaluating the script or the script has thrown an exception. EvalError may be thrown for a script syntax error, an evaluation error such as referring to an undefined variable, an internal error.

See Also:
  - `TargetError`
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`EvalError(String s, bsh.SimpleNode node, CallStack callstack)`

## Method Summary

Modifier and Type
Method
Description
`int`
`getErrorLineNumber()`
`String`
`getErrorSourceFile()`
`String`
`getErrorText()`
`String`
`getMessage()`
`String`
`getScriptStackTrace()`
`protected void`
`prependMessage(String s)`
Prepend the message if it is non-null.
`void`
`reThrow(String msg)`
Re-throw the error, prepending the specified message.
`void`
`setMessage(String s)`
`String`
`toString()`
Print the error with line number and stack trace.

### Methods inherited from class Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### EvalError

public EvalError(String s, bsh.SimpleNode node, CallStack callstack)

## Method Details

### toString

public String toString()
Print the error with line number and stack trace.

Overrides:
  `toString` in class `Throwable`

### reThrow

public void reThrow(String msg) throws EvalError
Re-throw the error, prepending the specified message.

Throws:
  `EvalError`

### getErrorText

public String getErrorText()

### getErrorLineNumber

public int getErrorLineNumber()

### getErrorSourceFile

public String getErrorSourceFile()

### getScriptStackTrace

public String getScriptStackTrace()

### getMessage

public String getMessage()

Overrides:
  `getMessage` in class `Throwable`
See Also:
  - for a full display of the information

### setMessage

public void setMessage(String s)

### prependMessage

protected void prependMessage(String s)
Prepend the message if it is non-null.