public interface DataExceptionContributor
Modifier and Type | Method and Description |
---|---|
default DataException |
addExceptionProperties(DataException exception)
Adds this object's current state to a
DataException . |
default DataException |
addExceptionProperties(DataException exception,
String namePrefix)
Adds this object's current state to a
DataException . |
static DataException |
contributeExceptionProperties(Throwable e,
DataExceptionContributor... contributors)
A utility method to add properties from a list of
DataExceptionContributor to the supplied exception. |
static DataException |
contributeExceptionProperties(Throwable e,
String namePrefix,
DataExceptionContributor... contributors)
A utility method to add properties from a list of
DataExceptionContributor to the supplied exception with the given name prefix. |
default DataException |
exception(String message)
Creates an exception with the specified message and containing this endpoint's properties (name-value pairs).
|
default DataException |
exception(String message,
Throwable exception)
Converts an exception to a
DataException , prefixing the original message with the specified text
and adding this endpoint's properties (name-value pairs). |
default DataException |
exception(Throwable exception)
Converts an exception to a
DataException and adds this endpoint's properties (name-value pairs). |
default DataException addExceptionProperties(DataException exception)
DataException
. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.default DataException addExceptionProperties(DataException exception, String namePrefix)
DataException
. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.
Use namePrefix
as the beginning of property keys: exception.set(namePrefix + ".fileType", fileType);
default DataException exception(String message, Throwable exception)
DataException
, prefixing the original message with the specified text
and adding this endpoint's properties (name-value pairs).
The returned exception can then be thrown in the normal way.
If the supplied exception is an instanceof DataException
, it will be returned, otherwise it will be
nested inside a DataException
. In either case the result message will contain the new prefix along
with this endpoint properties.
default DataException exception(Throwable exception)
DataException
and adds this endpoint's properties (name-value pairs).
The returned exception can then be thrown in the normal way.
If the supplied exception is an instanceof DataException
, it will be returned, otherwise it will be
nested inside a DataException
. In either case the result message will contain this endpoint properties.
default DataException exception(String message)
The returned exception can then be thrown in the normal way.
static DataException contributeExceptionProperties(Throwable e, DataExceptionContributor... contributors)
DataExceptionContributor
to the supplied exception.static DataException contributeExceptionProperties(Throwable e, String namePrefix, DataExceptionContributor... contributors)
DataExceptionContributor
to the supplied exception with the given name prefix.Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.