Package crystalpalace.spec
Class SpecProgramException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- crystalpalace.spec.SpecProgramException
-
- All Implemented Interfaces:
java.io.Serializable
public class SpecProgramException extends java.lang.ExceptionSomething went wrong while applying a specification file to some values- Author:
- Raphael Mudge
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SpecProgramException(crystalpalace.spec.SpecProgram program, java.lang.String message)Construct a new program exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description crystalpalace.spec.SpecObjectgetArgument()Returns the argument to the was-executing command.java.lang.StringgetCommand()Returns the last command that was run or running when this error occured.java.lang.StringgetFile()Get the file associated with this program.java.lang.StringgetFileName()Get the shortname of the file where this error occured.java.lang.StringgetMessage()Get the description of the error that generated this exception.java.util.StackgetStack()Get the stack from the .spec file's execution environment.java.lang.StringgetTarget()Get the target that was executing within the .specification file (e.g.,x86, x64).java.lang.StringtoString()Generate a sane string representation of this error and the context where it occurred.
-
-
-
Constructor Detail
-
SpecProgramException
public SpecProgramException(crystalpalace.spec.SpecProgram program, java.lang.String message)Construct a new program exception.- Parameters:
program- The program where the error occurred. We need this to pull state information via these APIs.message- A description of what went wrong. These are fairly specific.
-
-
Method Detail
-
getCommand
public java.lang.String getCommand()
Returns the last command that was run or running when this error occured.- Returns:
- the last command run
-
getArgument
public crystalpalace.spec.SpecObject getArgument()
Returns the argument to the was-executing command. This is usually the item that was most recently popped off of the program stack.- Returns:
- the argument when the last command was run
-
getStack
public java.util.Stack getStack()
Get the stack from the .spec file's execution environment. This offers an additional clue about the program state when the error occured.- Returns:
- the stack from the .spec file's execution environment
-
getMessage
public java.lang.String getMessage()
Get the description of the error that generated this exception. These are fairly descriptive and situation specific.- Overrides:
getMessagein classjava.lang.Throwable- Returns:
- the error message
-
getTarget
public java.lang.String getTarget()
Get the target that was executing within the .specification file (e.g.,x86, x64).- Returns:
- the target when the error occurred.
-
getFile
public java.lang.String getFile()
Get the file associated with this program. Note, in the case of therun "file.spec"command--it's possible that this file is not the parent file of the .spec. This will return the file where the error occured, not the top-level .spec file that was run.- Returns:
- the path to the file where this error occurred.
-
getFileName
public java.lang.String getFileName()
Get the shortname of the file where this error occured. In the case ofrun "file.spec"--the file associated with this error may differ from the top-level .spec file that was run viaLinkSpec- Returns:
- the short file name associated where this error occured.
-
toString
public java.lang.String toString()
Generate a sane string representation of this error and the context where it occurred. If I were using this API, I would just call this method and present the results to the end-user. They'll figure out what it means.- Overrides:
toStringin classjava.lang.Throwable- Returns:
- a string representation of this error
-
-