Exception CLASS

The exception class that can be thrown by scripts, or raised directly from the engine.

All Julian exceptions are derived from this class. An exception can be captured using the classic try-catch blocks, where exception are matched against each catch section in the script order.

For more information about exception handling, see here.

Parent Class

All Members


TypeNameSignature
constructorExceptionpublic Exception()
constructorExceptionpublic Exception(string)
constructorExceptionpublic Exception(string, System.Exception)
methodgetCausepublic Exception getCause()
methodgetMessagepublic String getMessage()
methodgetStackTracepublic String[] getStackTrace()
methodprintToErrorpublic void printToError()

Constructors


public Exception()

Create an exception without any specific information.


public Exception(string message)

Create an exception with message.

Parameters

  • message The message for this exception.

public Exception(string message, Exception cause)

Create an exception with message and cause, a.k.a the inner exception.

Parameters

  • message The message for this exception.
  • cause The inner cause for this exception, which is also an exception.

Methods


public Exception getCause()

Get the cause, a.k.a the inner exception, of this exception, if any.

Returns

  • Can be null if the cause was not specified during construction.

public String getMessage()

Get the message.

Returns

  • Can be null if the message was not specified during construction.

public String[] getStackTrace()

Get the current stack trace, starting from the function where the exception was thrown (originating function) and ending with the current function.

Returns

  • Can be null if the message was not specified during construction.

public void printToError()

Print the full stack trace to the standard error.

If the stack trace is too long, it might get truncated. If it's cause chain is longer than 4, the causes beyond the fourth will not be printed.