Package tech.ixor.calclox.exceptions
Class CalcLoxRunnerError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
tech.ixor.calclox.exceptions.CalcLoxRunnerError
- All Implemented Interfaces:
Serializable
Reports a CalcLox scanning, parsing, resolution, or runtime failure to the host.
The message is suitable for displaying to a user. getLine() identifies
the relevant one-based source line when one is available.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetLine()Returns the source line associated with the failure.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CalcLoxRunnerError
Creates an execution error.- Parameters:
message- description of the failureline- one-based source line, or-1when no source location is available
-
-
Method Details
-
getLine
public int getLine()Returns the source line associated with the failure.- Returns:
- the one-based source line, or
-1when unavailable
-