public class PunchRuntimeException extends RuntimeException
It is of highest importance to raise a useful error message to the user, one that pinpoint to the punchlet line where the error was thrown. Finding out that line number is the business implemented here.
The PunchCompileException stores the punchlet line number where the error was raised, so that the caller can react in a useful way. Typically an error message is included in the parsed log, so that the error can be detected without the log be lost.
If a punchlet suffers from a runtime jdk exception (i.e. ArrayOutOfBoundException), you can also get a PunchRuntimeException from it, that will pinpoint to the punchlet line where it actually happened.
Constructor and Description |
---|
PunchRuntimeException()
Constructs an
PunchException with no
detailed message. |
PunchRuntimeException(Exception cause)
Use this constructor after executing a punchlet, should it fail on a native runtime exception such
as ArrayOutOfBoundException for example.
|
PunchRuntimeException(String msg)
Constructs an
PunchException with the
specified detail message. |
PunchRuntimeException(String msg,
Exception cause) |
Modifier and Type | Method and Description |
---|---|
int |
getErrorLineNumber() |
String |
getLocation() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public PunchRuntimeException(Exception cause)
The PunchRuntimeException will extract the punchlet path and linenumber from it, so that the user will be pointed to that exact line of punchlet code.
cause
- the native root exceptionpublic PunchRuntimeException()
PunchException
with no
detailed message. It will simply report the punchlet path:linenum where it happened.public PunchRuntimeException(String msg)
PunchException
with the
specified detail message.msg
- the detailed message.public int getErrorLineNumber()
public String getLocation()
Copyright © 2023. All rights reserved.