public class BerliozException extends Exception implements org.pageseeder.xmlwriter.XMLWritable
This class should be used to wrap exceptions thrown by the tools or utility classes that are specific to this library.
For convenience, this class is XMLWritable
so
that if the exception is caught it can be converted into an XML message.
XMLWritable
,
Serialized FormConstructor and Description |
---|
BerliozException(String message)
Creates a new Berlioz exception.
|
BerliozException(String message,
ErrorID id)
Creates a new Berlioz exception wrapping an existing exception.
|
BerliozException(String message,
Exception cause)
Creates a new Berlioz exception wrapping an existing exception.
|
BerliozException(String message,
Exception cause,
ErrorID id)
Creates a new Berlioz exception wrapping an existing exception.
|
Modifier and Type | Method and Description |
---|---|
ErrorID |
id()
Returns the ID for this Berlioz Exception.
|
void |
setId(ErrorID id)
To set the error ID of this Berlioz exception.
|
void |
toXML(org.pageseeder.xmlwriter.XMLWriter xml)
Deprecated.
Will be removed in new releases
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public BerliozException(String message)
message
- The message.public BerliozException(String message, Exception cause)
message
- The message.cause
- The wrapped exception.public BerliozException(String message, ErrorID id)
message
- The message.id
- An error ID to help with error handling and diagnostic (may be null
)public final ErrorID id()
null
.public final void setId(ErrorID id)
id
- The error ID of the berlioz exception.@Deprecated public void toXML(org.pageseeder.xmlwriter.XMLWriter xml) throws IOException
The XML generated is as follows:
<berlioz-exception>
<message>message</message>
<code class="comment"><!-- Only if there is additional information --></code>
<cause>exception string value</cause>
<stack-trace>the stack trace</stack-trace>
</berlioz-exception>
toXML
in interface org.pageseeder.xmlwriter.XMLWritable
xml
- The XML writer to use.IOException
- Should an error be thrown while writingCopyright © 2016 Allette Systems. All rights reserved.