public class LocalisedBeanException extends AnchorCombinableException
To do this, all nested exceptions are traversed until null is found as a cause.
To determine the message string:
LocalisedBeanException
, its message
is added
as a line.
To determine the cause:
LocalisedBeanException
, and considers its {#link
getCause()} as the cause.
Constructor and Description |
---|
LocalisedBeanException(String message,
Throwable cause)
Create with a message and a cause.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canExceptionBeCombined(Throwable exception)
Can another exception be combined with this exception?
|
protected boolean |
canExceptionBeSkipped(Throwable exception)
Can another exception be skipped, when we combine with the current exception?
|
protected String |
createMessageForDescription(String message)
Creates a message for the exception from the description.
|
Throwable |
summarize()
Creates a new {link Throwable} that summarizes this exception and any nested causes of the
exception.
|
BeanXMLException |
summarizeIgnoreIdenticalFilePath(Path pathMatch)
If there is no nested-set of combinable exceptions, and the
message related to this
current exception is identical as the passed parameter, then we simply ignore the current
exception and promote its Throwable.getCause() . |
combineDescriptionsRecursively, findMostDeepCombinableException, getDescription, hasNoCombinableNestedExceptions
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
protected boolean canExceptionBeCombined(Throwable exception)
AnchorCombinableException
canExceptionBeCombined
in class AnchorCombinableException
exception
- the other exception to check if it can be combined.public Throwable summarize()
AnchorCombinableException
This can effectively combine a chain of nested exceptions into a single exception without a cause.
summarize
in class AnchorCombinableException
public BeanXMLException summarizeIgnoreIdenticalFilePath(Path pathMatch)
message
related to this
current exception is identical as the passed parameter, then we simply ignore the current
exception and promote its Throwable.getCause()
.
e.g. there's no point having two error lines e.g. indicating there's an error at file
SOMEPATH
. It's only worthwhile doing this, if there's some extra information, like an
include stack.
pathMatch
- the path we ignored, if it's localized to the same file (and nowhere else).protected boolean canExceptionBeSkipped(Throwable exception)
AnchorCombinableException
canExceptionBeSkipped
in class AnchorCombinableException
exception
- the other exception to check if it can be skipped.protected String createMessageForDescription(String message)
AnchorCombinableException
createMessageForDescription
in class AnchorCombinableException
message
- either a single description, or a combined descriptionCopyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.