class BundleService {

    protected FaultResponseDto faultResponseForException(final Exception exception,
            final List<FaultResponseParameterDto> parameters, final String defaultMessage) {

        final FaultResponseParametersDto faultResponseParameters = this.faultResponseParametersForList(parameters);

        if (exception instanceof FunctionalException || exception instanceof TechnicalException) {
            return this
                    .faultResponseForFunctionalOrTechnicalException((OsgpException) exception, faultResponseParameters,
                            defaultMessage);
        }

        return new FaultResponseDto.Builder().withMessage(defaultMessage)
                                             .withComponent(ComponentType.PROTOCOL_DLMS.name())
                                             .withInnerException(exception.getClass().getName())
                                             .withInnerMessage(exception.getMessage())
                                             .withFaultResponseParameters(faultResponseParameters).build();
    }

}