public Exception transform(Exception source, TransformationContext context) {
DataType<DataType> sourceType = context.getSourceDataType();
DataType<DataType> targetType = context.getTargetDataType();
ExceptionHandler exceptionHandler = getExceptionHandler(sourceType);
if (exceptionHandler == null) {
return source;
}
Object sourceFaultInfo = exceptionHandler.getFaultInfo(source);
Object targetFaultInfo =
mediator.mediate(sourceFaultInfo, sourceType.getLogical(), targetType.getLogical(), context.getMetadata());
ExceptionHandler targetHandler = getExceptionHandler(targetType);
if (targetHandler != null) {
Exception targetException =
targetHandler.createException(targetType, source.getMessage(), targetFaultInfo, source.getCause());
return targetException;
}
// FIXME
return source;