org.gjt.sp.jedit.bsh

## Class UtilEvalError

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - org.gjt.sp.jedit.bsh.UtilEvalError

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    Capabilities.Unavailable, ClassPathException, UtilTargetError

      public class UtilEvalError
      extends java.lang.Exception

  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`, Serialized Form

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `UtilEvalError()`
    `` | `UtilEvalError(java.lang.String s)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `EvalError` | `toEvalError(org.gjt.sp.jedit.bsh.SimpleNode node, CallStack callstack)`
    `EvalError` | `toEvalError(java.lang.String msg, org.gjt.sp.jedit.bsh.SimpleNode node, CallStack callstack)` Re-throw as an eval error, prefixing msg to the message and specifying the node.

    - ### Methods inherited from class java.lang.Throwable

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

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### UtilEvalError

          protected UtilEvalError()

    - #### UtilEvalError

          public UtilEvalError(java.lang.String s)

  - ### Method Detail

    - #### toEvalError

          public EvalError toEvalError(java.lang.String msg,
                                       org.gjt.sp.jedit.bsh.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` - may be null for no additional message.

    - #### toEvalError

          public EvalError toEvalError(org.gjt.sp.jedit.bsh.SimpleNode node,
                                       CallStack callstack)