Class CalcLoxRunnerError

All Implemented Interfaces:
Serializable

public class CalcLoxRunnerError extends RuntimeException
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 Details

    • CalcLoxRunnerError

      public CalcLoxRunnerError(String message, int line)
      Creates an execution error.
      Parameters:
      message - description of the failure
      line - one-based source line, or -1 when 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 -1 when unavailable