Class LineException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
LineExternalException,LineInputException,LineInternalException,LineNumericalException,LineUnsupportedException
It carries NO stack trace of its own. A line_error is a message
LINE wrote on purpose and its text already names the caller, so the frames
between the throw and whatever the user called (runAnalyzerChecks ->
runAnalyzer -> getAvg -> getAvgTable -> ...) are
noise: printing them buries a one-sentence refusal such as "finite station
capacity at station 'Queue2' is not supported by SolverNC" under a screen of
internal frames the user neither chose nor can act on. The JVM's default
handler, printStackTrace() and MATLAB's lang='java' bridge
then all report the message alone. This mirrors the empty-stack throw of
matlab/src/io/line_error.m.
The suppression is decided ONCE, when the exception is constructed, from
GlobalConstants.Verbose: at VerboseLevel.DEBUG the trace is
writable and the full chain comes back, which is what a developer wants.
Genuine JVM faults (IndexOutOfBoundsException,
NullPointerException) never come through here and are untouched.
A CAUSE KEEPS ITS OWN TRACE. Only this wrapper's frames are dropped, so
the "Caused by:" block of a re-reported failure still points at the line that
actually broke -- the whole reason line_error(caller, msg, cause)
exists.
It extends RuntimeException, which is what line_error threw
before, so every existing catch (RuntimeException) still catches it.
It carries an ErrorId from the cross-codebase vocabulary
(_kb/17-error-vocabulary.md); one subclass per category
(LineUnsupportedException, LineNumericalException,
LineInputException, LineExternalException,
LineInternalException) lets a caller catch by category.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLineException(String message) LineException(String message, Throwable cause) LineException(ErrorId errorId, String message, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionstatic LineExceptionBuilds the subclass that matches the id's category, so thatcatch (LineUnsupportedException e)sees every refusal however it was raised.static ErrorIdThe vocabulary id of any throwable: its own for aLineException,LINE:Errorotherwise.The identifier,LINE:Errorwhen the diagnostic is unclassified.The identifier as a string, e.g.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
LineException
- Parameters:
message- the already-formatted diagnostic
-
LineException
- Parameters:
message- the already-formatted diagnosticcause- the failure being re-reported, or null
-
LineException
- Parameters:
errorId- the identifier from the error vocabularymessage- the already-formatted diagnosticcause- the failure being re-reported, or null
-
-
Method Details
-
create
Builds the subclass that matches the id's category, so thatcatch (LineUnsupportedException e)sees every refusal however it was raised. -
getErrorId
The identifier,LINE:Errorwhen the diagnostic is unclassified. -
getIdentifier
The identifier as a string, e.g.LINE:unsupported:Cache. -
errorIdOf
The vocabulary id of any throwable: its own for aLineException,LINE:Errorotherwise.
-