|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
sleep.error.YourCodeSucksException
public class YourCodeSucksException
Syntax errors are a reality of programming. Any time a syntax error occurs when attempting to load a script the
exception YourCodeSucksException will be raised. [ yes, this exception name is staying ]
To catch a YourCodeSucksException:
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 Form| Constructor Summary | |
|---|---|
YourCodeSucksException(java.util.LinkedList myErrors)
Initialize the exception (sleep parser) |
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public YourCodeSucksException(java.util.LinkedList myErrors)
| Method Detail |
|---|
public java.lang.String getMessage()
getMessage in class java.lang.Throwablepublic java.lang.String toString()
toString in class java.lang.Throwablepublic void printErrors(java.io.OutputStream out)
public java.lang.String formatErrors()
public java.util.LinkedList getErrors()
SyntaxError objects.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||