Top Description Constructors Methods
bsh

public Class UtilEvalError

extends Exception
Class Inheritance
Known Direct Subclasses
bsh.ClassPathException, bsh.Capabilities.Unavailable, bsh.UtilTargetError

UtilEvalError is an error corresponding to an EvalError but thrown by a utility or other class that does not have the caller context (Node) available to it. A normal EvalError must supply the caller Node in order for error messages to be pinned to the correct line and location in the script. UtilEvalError is a checked exception that is *not* a subtype of EvalError, but instead must be caught and rethrown as an EvalError by the a nearest location with context. The method toEvalError( Node ) should be used to throw the EvalError, supplying the node.

To summarize: Utilities throw UtilEvalError. ASTs throw EvalError. ASTs catch UtilEvalError and rethrow it as EvalError using toEvalError( Node ).

Philosophically, EvalError and UtilEvalError corrospond to RuntimeException. However they are constrained in this way in order to add the context for error reporting.

See Also
UtilTargetError

Constructor Summary

AccessConstructor and Description
protected
public

Method Summary

Modifier and TypeMethod and Description
public EvalError
toEvalError(String
may be null for no additional message.
msg
,
SimpleNode node, CallStack callstack)

Re-throw as an eval error, prefixing msg to the message and specifying the node.

public EvalError
toEvalError(SimpleNode node, CallStack callstack)

Constructor Detail

UtilEvalErrorback to summary
protected UtilEvalError()
UtilEvalErrorback to summary
public UtilEvalError(String s)

Method Detail

toEvalErrorback to summary
public EvalError toEvalError(String msg, SimpleNode node, CallStack callstack)

Re-throw as an eval error, prefixing msg to the message and specifying the node. If a node already exists the addNode is ignored.

Parameters
msg:String

may be null for no additional message.

See Also
<p>
toEvalErrorback to summary
public EvalError toEvalError(SimpleNode node, CallStack callstack)