public class YourCodeSucksException
extends java.lang.RuntimeException
try { ScriptInstance script; script = loader.loadScript("name", inputStream); } catch (YourCodeSucksException ex) { Iterator i = ex.getErrors().iterator(); while (i.hasNext()) { SyntaxError error = (SyntaxError)i.next(); String description = error.getDescription(); String code = error.getCodeSnippet(); int lineNumber = error.getLineNumber(); } }
SyntaxError
,
Serialized FormConstructor and Description |
---|
YourCodeSucksException(java.util.LinkedList myErrors)
Initialize the exception (sleep parser)
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
formatErrors()
generate a nicely formatted string representation of the script errors in this exception
|
java.util.LinkedList |
getErrors()
All of the errors are stored in a linked list.
|
java.lang.String |
getMessage()
Returns a minimal string representation of the errors within this exception
|
void |
printErrors(java.io.OutputStream out)
print a nicely formatted version of the script errors to the specified stream
|
java.lang.String |
toString()
Returns a simple string representation of the errors within this exception
|
public YourCodeSucksException(java.util.LinkedList myErrors)
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public java.lang.String toString()
toString
in class java.lang.Throwable
public void printErrors(java.io.OutputStream out)
public java.lang.String formatErrors()
public java.util.LinkedList getErrors()
SyntaxError
objects.