@Override
  protected void handleError(
      final Exception e,
      final DeviceMessageMetadata deviceMessageMetadata,
      final ResponseMessage responseMessage)
      throws FunctionalException {

    final OsgpException osgpException = this.ensureOsgpException(e);

    final BundleMessagesRequestDto bundleMessagesResponseDto =
        (BundleMessagesRequestDto) responseMessage.getDataObject();

    final List<ActionDto> actionList = bundleMessagesResponseDto.getActionList();
    for (final ActionDto action : actionList) {
      if (action.getResponse() == null) {
        action.setResponse(
            new ActionResponseDto(OsgpResultTypeDto.NOT_OK, e, "Unable to handle request"));
      }
    }

    this.bundleService.handleBundleResponse(
        deviceMessageMetadata,
        responseMessage.getResult(),
        osgpException,
        bundleMessagesResponseDto);
  }
  @Override
  protected void handleMessage(
      final DeviceMessageMetadata deviceMessageMetadata,
      final ResponseMessage responseMessage,
      final OsgpException osgpException)
      throws FunctionalException {

    final BundleMessagesRequestDto bundleMessagesResponseDto =
        (BundleMessagesRequestDto) responseMessage.getDataObject();

    this.bundleService.handleBundleResponse(
        deviceMessageMetadata,
        responseMessage.getResult(),
        osgpException,
        bundleMessagesResponseDto);
  }
 @Override
 protected boolean hasRegularResponseObject(final ResponseMessage responseMessage) {
   return responseMessage.getDataObject() instanceof BundleMessagesRequestDto;
 }