sleep.error
Class YourCodeSucksException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended bysleep.error.YourCodeSucksException
All Implemented Interfaces:
Serializable

public class YourCodeSucksException
extends RuntimeException

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();
    }
 }
 

See Also:
SyntaxError, Serialized Form

Constructor Summary
YourCodeSucksException(LinkedList myErrors)
           
 
Method Summary
 LinkedList getErrors()
          All of the errors are stored in a linked list.
 String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, 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

YourCodeSucksException

public YourCodeSucksException(LinkedList myErrors)
Method Detail

toString

public String toString()

getErrors

public LinkedList getErrors()
All of the errors are stored in a linked list. The linked list contains SyntaxError objects.